Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
531b3ba3f2 | ||
|
|
d0036b729d | ||
|
|
4d791d2213 | ||
|
|
19fc90b830 | ||
|
|
4f0fe7bab5 | ||
|
|
7323f68e62 | ||
|
|
a33b08a0c3 | ||
|
|
c8fdd29cf4 | ||
|
|
00615b92a0 | ||
|
|
832be3d797 | ||
|
|
72f9d88f96 | ||
|
|
d4a6b142c5 | ||
|
|
8da4dc9d75 | ||
|
|
6ad0aa3e23 | ||
|
|
11c5352555 | ||
|
|
a0bdb9a535 | ||
|
|
37d69e3ddc | ||
|
|
524da71a45 | ||
|
|
3949d6d13c | ||
|
|
d5591b2c91 | ||
|
|
97d19f1d17 | ||
|
|
282a959f88 | ||
|
|
aaa6cdf704 | ||
|
|
bc1614c71b | ||
|
|
b71656d0a6 | ||
|
|
9374f4ab46 | ||
|
|
3b3e65bd1c | ||
|
|
ce035e2204 | ||
|
|
70c0c25521 |
No files matched your search
+159
-37
@@ -18,6 +18,11 @@ jobs:
|
||||
run: |
|
||||
Set-Content -Path ".env" -Value "${{ secrets.ENV_FILE_CONTENT }}"
|
||||
|
||||
- name: Pulizia Cache Dart e Download Dipendenze
|
||||
run: |
|
||||
if (Test-Path ".dart_tool") { Remove-Item -Recurse -Force ".dart_tool" }
|
||||
flutter pub get
|
||||
|
||||
- name: Build Flutter Windows
|
||||
run: flutter build windows --release
|
||||
|
||||
@@ -49,50 +54,30 @@ jobs:
|
||||
files: "build/windows/installer/FluxInstaller.exe"
|
||||
api_key: ${{ secrets.MYRELEASE_TOKEN }}
|
||||
|
||||
- name: Aggiorna Link Windows su Supabase
|
||||
run: |
|
||||
$TagVersion = "${{ github.ref_name }}".TrimStart('v')
|
||||
$headers = @{
|
||||
"apikey" = "${{ secrets.SUPABASE_SERVICE_KEY }}"
|
||||
"Authorization" = "Bearer ${{ secrets.SUPABASE_SERVICE_KEY }}"
|
||||
"Content-Type" = "application/json"
|
||||
}
|
||||
$body = (@{
|
||||
download_url = "https://gitea.catelli.it/brontomark/flux/releases/download/${{ github.ref_name }}/FluxInstaller.exe"
|
||||
latest_version = $TagVersion
|
||||
} | ConvertTo-Json)
|
||||
Invoke-RestMethod -Uri "https://pvqpjloswwvtfoxbkfbh.supabase.co/rest/v1/app_config?platform=eq.windows" -Method Patch -Headers $headers -Body $body -UserAgent "flux-runner"
|
||||
|
||||
- name: Pulisci Workspace Windows
|
||||
if: always()
|
||||
run: Remove-Item -Recurse -Force ./*
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# JOB 2: ANDROID APK (Gira sul tuo MacBook)
|
||||
# -----------------------------------------------------------------
|
||||
build-android:
|
||||
runs-on: macos-runner # <--- Etichetta del tuo Mac
|
||||
steps:
|
||||
- name: Checkout del codice
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Logica Bash per Mac: usiamo le virgolette singole forti per evitare escape strani
|
||||
- name: Crea file .env
|
||||
run: |
|
||||
cat << 'EOF' > .env
|
||||
${{ secrets.ENV_FILE_CONTENT }}
|
||||
EOF
|
||||
|
||||
- name: Build Flutter APK
|
||||
run: flutter build apk --release
|
||||
|
||||
# Carichiamo l'APK universale o quelli splittati nelle release di Gitea
|
||||
- name: Upload Android Asset
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: "build/app/outputs/flutter-apk/app-release.apk"
|
||||
api_key: ${{ secrets.MYRELEASE_TOKEN }}
|
||||
|
||||
- name: Aggiorna Link Android su Supabase
|
||||
run: |
|
||||
curl -X PATCH "https://pvqpjloswwvtfoxbkfbh.supabase.co/rest/v1/app_config?id=eq.49f18b19-2129-46c0-b690-a97db725b5a8" -H "apikey: ${{ secrets.SUPABASE_SERVICE_KEY }}" -H "Authorization: Bearer ${{ secrets.SUPABASE_SERVICE_KEY }}" -H "Content-Type: application/json" -d "{\"download_url\": \"https://gitea.catelli.it/brontomark/flux/releases/download/${{ github.ref_name }}/app-release.apk\"}"
|
||||
|
||||
- name: Aggiorna Link Windows su Supabase
|
||||
run: |
|
||||
curl -X PATCH "https://pvqpjloswwvtfoxbkfbh.supabase.co/rest/v1/app_config?id=eq.1f888b30-5cbf-4a16-820c-5036a3af0cf8" -H "apikey: ${{ secrets.SUPABASE_SERVICE_KEY }}" -H "Authorization: Bearer ${{ secrets.SUPABASE_SERVICE_KEY }}" -H "Content-Type: application/json" -d "{\"download_url\": \"https://gitea.catelli.it/brontomark/flux/releases/download/${{ github.ref_name }}/FluxInstaller.exe\"}"
|
||||
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# JOB 3: WEB & CLOUDFLARE DEPLOY (Gira sul tuo MacBook)
|
||||
# JOB 3: WEB & CLOUDFLARE DEPLOY (Gira sul runner Fedora o Mac)
|
||||
# -----------------------------------------------------------------
|
||||
build-web:
|
||||
runs-on: macos-runner # <--- Etichetta del tuo Mac
|
||||
runs-on: cross-runner
|
||||
steps:
|
||||
- name: Checkout del codice
|
||||
uses: actions/checkout@v3
|
||||
@@ -103,6 +88,11 @@ jobs:
|
||||
${{ secrets.ENV_FILE_CONTENT }}
|
||||
EOF
|
||||
|
||||
- name: Pulizia Cache e Fetch Dipendenze
|
||||
run: |
|
||||
rm -rf .dart_tool
|
||||
flutter pub get
|
||||
|
||||
- name: Build Flutter Web
|
||||
run: flutter build web --release
|
||||
|
||||
@@ -112,4 +102,136 @@ jobs:
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
run: |
|
||||
npx wrangler pages deploy build/web --project-name="flux" --branch="main"
|
||||
npx wrangler pages deploy build/web --project-name="flux" --branch="main"
|
||||
|
||||
- name: Aggiorna Versione Web su Supabase
|
||||
run: |
|
||||
TagVersion="${GITHUB_REF_NAME#v}"
|
||||
curl -X PATCH "https://pvqpjloswwvtfoxbkfbh.supabase.co/rest/v1/app_config?platform=eq.web" \
|
||||
-H "apikey: ${{ secrets.SUPABASE_SERVICE_KEY }}" \
|
||||
-H "Authorization: Bearer ${{ secrets.SUPABASE_SERVICE_KEY }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"latest_version\": \"$TagVersion\"}"
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# JOB 4: LINUX APPIMAGE (Gira sul tuo PC Fedora / Linux Runner)
|
||||
# -----------------------------------------------------------------
|
||||
build-linux:
|
||||
runs-on: linux-runner # <--- Etichetta del tuo runner Linux / Fedora in ufficio
|
||||
steps:
|
||||
- name: Checkout del codice
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Crea file .env
|
||||
run: |
|
||||
cat << 'EOF' > .env
|
||||
${{ secrets.ENV_FILE_CONTENT }}
|
||||
EOF
|
||||
|
||||
- name: Pulizia Cache e Fetch Dipendenze
|
||||
run: |
|
||||
rm -rf .dart_tool
|
||||
flutter pub get
|
||||
|
||||
- name: Build Flutter Linux
|
||||
run: flutter build linux --release
|
||||
|
||||
- name: Prepara AppDir per AppImage
|
||||
run: |
|
||||
mkdir -p build/Flux.AppDir
|
||||
cp -r build/linux/x64/release/bundle/* build/Flux.AppDir/
|
||||
cp assets/icon/icon.png build/Flux.AppDir/flux.png
|
||||
|
||||
cat << 'EOF' > build/Flux.AppDir/AppRun
|
||||
#!/bin/sh
|
||||
cd "$(dirname "$0")"
|
||||
exec ./flux "$@"
|
||||
EOF
|
||||
chmod +x build/Flux.AppDir/AppRun
|
||||
|
||||
cat << 'EOF' > build/Flux.AppDir/Flux.desktop
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Name=Flux
|
||||
Exec=flux %u
|
||||
Icon=flux
|
||||
Categories=Utility;
|
||||
EOF
|
||||
|
||||
- name: Scarica appimagetool se non presente
|
||||
run: |
|
||||
if [ ! -f ./appimagetool-x86_64.AppImage ]; then
|
||||
curl -L -o appimagetool-x86_64.AppImage https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
|
||||
chmod +x appimagetool-x86_64.AppImage
|
||||
fi
|
||||
|
||||
- name: Genera AppImage
|
||||
run: |
|
||||
ARCH=x86_64 ./appimagetool-x86_64.AppImage build/Flux.AppDir Flux-x86_64.AppImage
|
||||
|
||||
- name: Upload Linux AppImage Asset
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: "Flux-x86_64.AppImage"
|
||||
api_key: ${{ secrets.MYRELEASE_TOKEN }}
|
||||
|
||||
- name: Aggiorna Link Linux su Supabase
|
||||
run: |
|
||||
TagVersion="${GITHUB_REF_NAME#v}"
|
||||
curl -X PATCH "https://pvqpjloswwvtfoxbkfbh.supabase.co/rest/v1/app_config?platform=eq.AppImage" \
|
||||
-H "apikey: ${{ secrets.SUPABASE_SERVICE_KEY }}" \
|
||||
-H "Authorization: Bearer ${{ secrets.SUPABASE_SERVICE_KEY }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"download_url\": \"https://gitea.catelli.it/brontomark/flux/releases/download/${{ github.ref_name }}/Flux-x86_64.AppImage\", \"latest_version\": \"$TagVersion\"}"
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# JOB 5: MACOS (Gira sul tuo Mac / macos-runner)
|
||||
# -----------------------------------------------------------------
|
||||
build-macos:
|
||||
runs-on: macos-runner
|
||||
steps:
|
||||
- name: Checkout del codice
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Crea file .env
|
||||
run: |
|
||||
cat << 'EOF' > .env
|
||||
${{ secrets.ENV_FILE_CONTENT }}
|
||||
EOF
|
||||
|
||||
- name: Pulizia Cache e Fetch Dipendenze
|
||||
run: |
|
||||
rm -rf .dart_tool
|
||||
flutter pub get
|
||||
|
||||
- name: Build Flutter macOS
|
||||
run: flutter build macos --release
|
||||
|
||||
- name: Genera DMG e ZIP macOS
|
||||
run: |
|
||||
# Crea DMG dell'applicazione
|
||||
hdiutil create -volname "Flux" -srcfolder "build/macos/Build/Products/Release/flux.app" -ov -format UDZO "Flux-macOS.dmg"
|
||||
|
||||
# Crea anche archivio ZIP di backup
|
||||
cd build/macos/Build/Products/Release
|
||||
zip -r -y ../../../../Flux-macOS.zip "flux.app"
|
||||
cd -
|
||||
|
||||
- name: Upload macOS Assets
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: |
|
||||
Flux-macOS.dmg
|
||||
Flux-macOS.zip
|
||||
api_key: ${{ secrets.MYRELEASE_TOKEN }}
|
||||
|
||||
- name: Aggiorna Link macOS su Supabase
|
||||
run: |
|
||||
TagVersion="${GITHUB_REF_NAME#v}"
|
||||
curl -X PATCH "https://pvqpjloswwvtfoxbkfbh.supabase.co/rest/v1/app_config?platform=eq.macos" \
|
||||
-H "apikey: ${{ secrets.SUPABASE_SERVICE_KEY }}" \
|
||||
-H "Authorization: Bearer ${{ secrets.SUPABASE_SERVICE_KEY }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"download_url\": \"https://gitea.catelli.it/brontomark/flux/releases/download/${{ github.ref_name }}/Flux-macOS.dmg\", \"latest_version\": \"$TagVersion\"}"
|
||||
@@ -11,6 +11,10 @@ analyzer:
|
||||
- "ios/**"
|
||||
- "macos/**"
|
||||
- ".dart_tool/**"
|
||||
- android/**
|
||||
- web/**
|
||||
- windows/**
|
||||
- linux/**
|
||||
|
||||
linter:
|
||||
rules:
|
||||
|
||||
@@ -28,14 +28,19 @@ class SessionCubit extends Cubit<SessionState> {
|
||||
: super(const SessionState(status: SessionStatus.initial)) {
|
||||
initializeSession();
|
||||
// Possiamo metterci in ascolto dei cambiamenti di Auth (Login/Logout)
|
||||
_supabase.auth.onAuthStateChange.listen((data) {
|
||||
final AuthChangeEvent event = data.event;
|
||||
if (event == AuthChangeEvent.signedIn) {
|
||||
initializeSession();
|
||||
} else if (event == AuthChangeEvent.signedOut) {
|
||||
emit(const SessionState(status: SessionStatus.unauthenticated));
|
||||
}
|
||||
});
|
||||
_supabase.auth.onAuthStateChange.listen(
|
||||
(data) {
|
||||
final AuthChangeEvent event = data.event;
|
||||
if (event == AuthChangeEvent.signedIn) {
|
||||
initializeSession();
|
||||
} else if (event == AuthChangeEvent.signedOut) {
|
||||
emit(const SessionState(status: SessionStatus.unauthenticated));
|
||||
}
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
debugPrint('Auth state change error: $error');
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> initializeSession() async {
|
||||
|
||||
@@ -18,6 +18,8 @@ class Tables {
|
||||
static const String staffInStores = 'staff_in_stores';
|
||||
static const String staffMembers = 'staff_members';
|
||||
static const String stores = 'stores';
|
||||
static const String targets = 'targets';
|
||||
static const String individualTargets = 'individual_targets';
|
||||
static const String tasks = 'tasks';
|
||||
static const String taskAssignments = 'task_assignments';
|
||||
static const String taskReminders = 'task_reminders';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flux/core/routes/routes.dart';
|
||||
import 'package:flux/core/utils/extensions.dart';
|
||||
import 'package:flux/core/widgets/app_version_label.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
// ==========================================
|
||||
@@ -147,6 +148,14 @@ class _AppMenuState extends State<AppMenu> {
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 8),
|
||||
_buildRouteItem(
|
||||
title: 'Obiettivi',
|
||||
icon: Icons.track_changes_outlined,
|
||||
routeName: Routes.targets,
|
||||
pathToCheck: '/targets',
|
||||
isCollapsed: effectivelyCollapsed,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
// --- IL MENU GERARCHICO (ANAGRAFICHE) ---
|
||||
@@ -189,6 +198,12 @@ class _AppMenuState extends State<AppMenu> {
|
||||
),
|
||||
),
|
||||
|
||||
// --- VERSIONE APP CON HYPERLINK ---
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: AppVersionLabel(isCollapsed: effectivelyCollapsed),
|
||||
),
|
||||
|
||||
// --- PULSANTE TOGGLE (Solo Desktop) ---
|
||||
if (!widget.isDrawer)
|
||||
Padding(
|
||||
@@ -249,7 +264,9 @@ class _AppMenuState extends State<AppMenu> {
|
||||
),
|
||||
child: Icon(
|
||||
icon,
|
||||
color: isSelected ? theme.colorScheme.primary : null,
|
||||
color: isSelected
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -262,11 +279,19 @@ class _AppMenuState extends State<AppMenu> {
|
||||
alpha: 0.4,
|
||||
),
|
||||
selected: isSelected,
|
||||
leading: Icon(icon, color: isSelected ? theme.colorScheme.primary : null),
|
||||
leading: Icon(
|
||||
icon,
|
||||
color: isSelected
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
title: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
|
||||
color: isSelected
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurface,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.clip,
|
||||
@@ -313,7 +338,7 @@ class _AppMenuState extends State<AppMenu> {
|
||||
: FontWeight.normal,
|
||||
color: widget.currentPath == item.pathToCheck
|
||||
? theme.colorScheme.primary
|
||||
: null,
|
||||
: theme.colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -330,7 +355,9 @@ class _AppMenuState extends State<AppMenu> {
|
||||
),
|
||||
child: Icon(
|
||||
icon,
|
||||
color: isSelected ? theme.colorScheme.primary : null,
|
||||
color: isSelected
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -344,12 +371,17 @@ class _AppMenuState extends State<AppMenu> {
|
||||
tilePadding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
leading: Icon(
|
||||
icon,
|
||||
color: isSelected ? theme.colorScheme.primary : null,
|
||||
color: isSelected
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
title: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
|
||||
color: isSelected
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurface,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.clip,
|
||||
@@ -375,7 +407,7 @@ class _AppMenuState extends State<AppMenu> {
|
||||
: FontWeight.normal,
|
||||
color: isSubSelected
|
||||
? theme.colorScheme.primary
|
||||
: theme.textTheme.bodyMedium?.color,
|
||||
: theme.colorScheme.onSurface,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.clip,
|
||||
|
||||
@@ -18,9 +18,11 @@ import 'package:flux/features/customers/models/customer_model.dart';
|
||||
import 'package:flux/features/customers/ui/customer_detail_screen.dart';
|
||||
import 'package:flux/features/customers/ui/customer_form_screen.dart';
|
||||
import 'package:flux/features/customers/ui/customers_list_screen.dart';
|
||||
import 'package:flux/features/home/dashboard_expiring_contracts/bloc/dashboard_expiring_contracts_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_note_list/blocs/dashboard_note_list_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_store_operation_list/bloc/dashboard_store_operation_list_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_store_ticket_list/blocs/dashboard_store_ticket_list_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_target_progress/blocs/dashboard_target_progress_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_task_list/blocs/dashboard_task_list_cubit.dart';
|
||||
import 'package:flux/features/home/ui/home_screen.dart';
|
||||
import 'package:flux/features/master_data/master_data_hub_content.dart';
|
||||
@@ -61,8 +63,18 @@ import 'package:flux/features/tickets/models/ticket_model.dart';
|
||||
import 'package:flux/features/tickets/ui/ticket_form_screen.dart';
|
||||
import 'package:flux/features/tickets/ui/ticket_list_screen.dart';
|
||||
import 'package:flux/features/tickets/ui/ticket_workspace/ticket_workspace_screen.dart';
|
||||
import 'package:flux/features/targets/blocs/target_form_cubit.dart';
|
||||
import 'package:flux/features/targets/blocs/target_list_cubit.dart';
|
||||
import 'package:flux/features/targets/data/targets_repository.dart';
|
||||
import 'package:flux/features/targets/models/target_model.dart';
|
||||
import 'package:flux/features/targets/blocs/target_detail_cubit.dart';
|
||||
import 'package:flux/features/targets/ui/target_detail_screen.dart';
|
||||
import 'package:flux/features/targets/ui/target_form_screen.dart';
|
||||
import 'package:flux/features/targets/ui/target_list_screen.dart';
|
||||
import 'package:flux/features/master_data/staff/data/staff_repository.dart';
|
||||
import 'package:flux/features/tracking/blocs/tracking_cubit.dart';
|
||||
import 'package:flux/features/tracking/models/tracking_model.dart';
|
||||
import 'package:flux/service_locator.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
@@ -179,6 +191,19 @@ class AppRouter {
|
||||
staffId: sessionCubit.state.currentStaffMember?.id,
|
||||
),
|
||||
),
|
||||
BlocProvider<DashboardTargetProgressCubit>(
|
||||
create: (context) => DashboardTargetProgressCubit(
|
||||
companyId: sessionCubit.state.company?.id,
|
||||
storeId: sessionCubit.state.currentStore?.id,
|
||||
staffId: sessionCubit.state.currentStaffMember?.id,
|
||||
),
|
||||
),
|
||||
BlocProvider<DashboardExpiringContractsCubit>(
|
||||
create: (context) => DashboardExpiringContractsCubit(
|
||||
companyId: sessionCubit.state.company?.id,
|
||||
storeId: sessionCubit.state.currentStore?.id,
|
||||
),
|
||||
),
|
||||
],
|
||||
child: const HomeScreen(),
|
||||
);
|
||||
@@ -311,10 +336,52 @@ class AppRouter {
|
||||
);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: '/targets',
|
||||
name: Routes.targets,
|
||||
builder: (context, state) => BlocProvider(
|
||||
create: (_) => sl<TargetListCubit>(),
|
||||
child: const TargetListScreen(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// --- DETTAGLI E OPERATIVITÀ (FUORI DALLA SHELL - TUTTO SCHERMO) ---
|
||||
GoRoute(
|
||||
path: '/targets/form',
|
||||
name: Routes.targetForm,
|
||||
builder: (context, state) {
|
||||
final existingTarget = state.extra as TargetModel?;
|
||||
final session = context.read<SessionCubit>().state;
|
||||
final companyId = session.company?.id ?? '';
|
||||
final defaultStoreId = session.currentStore?.id ?? '';
|
||||
|
||||
return BlocProvider<TargetFormCubit>(
|
||||
create: (context) => TargetFormCubit(
|
||||
targetsRepository: sl<TargetsRepository>(),
|
||||
staffRepository: sl<StaffRepository>(),
|
||||
staffCubit: context.read<StaffCubit>(),
|
||||
)..init(
|
||||
initialTarget: existingTarget,
|
||||
companyId: companyId,
|
||||
defaultStoreId: defaultStoreId,
|
||||
),
|
||||
child: const TargetFormScreen(),
|
||||
);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: '/targets/detail',
|
||||
name: Routes.targetDetail,
|
||||
builder: (context, state) {
|
||||
final target = state.extra as TargetModel;
|
||||
return BlocProvider<TargetDetailCubit>(
|
||||
create: (context) => TargetDetailCubit(target: target)..init(),
|
||||
child: TargetDetailScreen(target: target),
|
||||
);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: '/providers/form',
|
||||
name: Routes.providerForm,
|
||||
|
||||
@@ -27,4 +27,7 @@ class Routes {
|
||||
static const String tasks = 'tasks';
|
||||
static const String taskForm = 'task-form';
|
||||
static const String reminderSettings = 'reminder-settings';
|
||||
static const String targets = 'targets';
|
||||
static const String targetForm = 'target-form';
|
||||
static const String targetDetail = 'target-detail';
|
||||
}
|
||||
+36
-12
@@ -104,11 +104,25 @@ ThemeData fluxDarkTheme = ThemeData(
|
||||
),
|
||||
),
|
||||
|
||||
drawerTheme: const DrawerThemeData(
|
||||
backgroundColor: FluxColors.darkSurface,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
),
|
||||
|
||||
expansionTileTheme: const ExpansionTileThemeData(
|
||||
iconColor: FluxColors.accentTurquoise,
|
||||
collapsedIconColor: FluxColors.darkTextSecondary,
|
||||
textColor: FluxColors.darkTextPrimary,
|
||||
collapsedTextColor: FluxColors.darkTextPrimary,
|
||||
),
|
||||
|
||||
listTileTheme: ListTileThemeData(
|
||||
// Definiamo la forma arrotondata (fondamentale per l'effetto moderno)
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
// Colore dell'icona (Turchese Flux)
|
||||
iconColor: FluxColors.accentTurquoise,
|
||||
selectedColor: FluxColors.primaryBlue,
|
||||
selectedTileColor: FluxColors.primaryBlue.withValues(alpha: 0.15),
|
||||
// Colore del testo
|
||||
titleTextStyle: GoogleFonts.poppins(
|
||||
color: FluxColors.darkTextPrimary,
|
||||
@@ -121,9 +135,6 @@ ThemeData fluxDarkTheme = ThemeData(
|
||||
),
|
||||
// Per far apparire la "manina" su Web/Desktop
|
||||
mouseCursor: WidgetStateProperty.all(SystemMouseCursors.click),
|
||||
|
||||
// NOTA: Se overlayColor non esiste, Flutter userà i colori
|
||||
// di default del tema (splashColor e hoverColor) definiti nel ThemeData generale.
|
||||
),
|
||||
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
@@ -189,26 +200,37 @@ ThemeData fluxLightTheme = ThemeData(
|
||||
),
|
||||
),
|
||||
|
||||
drawerTheme: const DrawerThemeData(
|
||||
backgroundColor: FluxColors.lightSurface,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
),
|
||||
|
||||
expansionTileTheme: const ExpansionTileThemeData(
|
||||
iconColor: FluxColors.accentTurquoise,
|
||||
collapsedIconColor: FluxColors.lightTextSecondary,
|
||||
textColor: FluxColors.lightTextPrimary,
|
||||
collapsedTextColor: FluxColors.lightTextPrimary,
|
||||
),
|
||||
|
||||
listTileTheme: ListTileThemeData(
|
||||
// Definiamo la forma arrotondata (fondamentale per l'effetto moderno)
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
// Colore dell'icona (Turchese Flux)
|
||||
iconColor: FluxColors.accentTurquoise,
|
||||
// Colore del testo
|
||||
selectedColor: FluxColors.primaryBlue,
|
||||
selectedTileColor: FluxColors.primaryBlue.withValues(alpha: 0.1),
|
||||
// Colore del testo per il tema chiaro
|
||||
titleTextStyle: GoogleFonts.poppins(
|
||||
color: FluxColors.darkTextPrimary,
|
||||
color: FluxColors.lightTextPrimary,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
subtitleTextStyle: GoogleFonts.poppins(
|
||||
color: FluxColors.darkTextSecondary,
|
||||
color: FluxColors.lightTextSecondary,
|
||||
fontSize: 13,
|
||||
),
|
||||
// Per far apparire la "manina" su Web/Desktop
|
||||
mouseCursor: WidgetStateProperty.all(SystemMouseCursors.click),
|
||||
|
||||
// NOTA: Se overlayColor non esiste, Flutter userà i colori
|
||||
// di default del tema (splashColor e hoverColor) definiti nel ThemeData generale.
|
||||
),
|
||||
|
||||
// Il pulsante principale rimane Blu Elettrico, molto visibile
|
||||
@@ -260,12 +282,14 @@ extension FluxThemeContext on BuildContext {
|
||||
// --- Testi (La parte mancante) ---
|
||||
// Mappiamo primaryText sul colore del titolo e secondaryText su quello del corpo
|
||||
Color get primaryText =>
|
||||
Theme.of(this).textTheme.titleLarge?.color ?? Colors.white;
|
||||
Theme.of(this).textTheme.titleLarge?.color ??
|
||||
Theme.of(this).colorScheme.onSurface;
|
||||
Color get secondaryText =>
|
||||
Theme.of(this).textTheme.bodyMedium?.color ?? Colors.grey;
|
||||
Theme.of(this).textTheme.bodyMedium?.color ??
|
||||
Theme.of(this).colorScheme.onSurfaceVariant;
|
||||
|
||||
// Opzionale: un colore ancora più tenue per suggerimenti o icone disabilitate
|
||||
Color get hintText =>
|
||||
Theme.of(this).textTheme.bodySmall?.color ??
|
||||
Colors.grey.withValues(alpha: 0.5);
|
||||
Theme.of(this).colorScheme.onSurface.withValues(alpha: 0.5);
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class AutoUpdateService {
|
||||
/// Verifica se la piattaforma corrente supporta l'aggiornamento automatico trasparente
|
||||
static bool get isAutoUpdateSupported {
|
||||
if (kIsWeb) return false;
|
||||
if (Platform.isWindows) return true;
|
||||
if (Platform.isLinux && Platform.environment['APPIMAGE'] != null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Scarica l'aggiornamento e lo applica in modo silenzioso
|
||||
static Future<void> downloadAndApplyUpdate({
|
||||
required String downloadUrl,
|
||||
required void Function(double progress, String status) onProgress,
|
||||
}) async {
|
||||
if (kIsWeb) {
|
||||
throw UnsupportedError("L'auto-update non è supportato su Web.");
|
||||
}
|
||||
|
||||
if (Platform.isWindows) {
|
||||
await _updateWindows(downloadUrl, onProgress);
|
||||
} else if (Platform.isLinux) {
|
||||
await _updateLinux(downloadUrl, onProgress);
|
||||
} else {
|
||||
throw UnsupportedError("Piattaforma non supportata per l'auto-update.");
|
||||
}
|
||||
}
|
||||
|
||||
/// Gestione aggiornamento Windows
|
||||
static Future<void> _updateWindows(
|
||||
String downloadUrl,
|
||||
void Function(double progress, String status) onProgress,
|
||||
) async {
|
||||
final tempDir = Directory.systemTemp;
|
||||
final installerFile = File('${tempDir.path}\\FluxInstaller_Update.exe');
|
||||
|
||||
if (installerFile.existsSync()) {
|
||||
try {
|
||||
installerFile.deleteSync();
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
onProgress(0.0, "Download aggiornamento in corso...");
|
||||
await _downloadFile(downloadUrl, installerFile, onProgress);
|
||||
|
||||
onProgress(1.0, "Installazione e riavvio in corso...");
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
// Lancia l'installer in modalità silenziosa per utente singolo
|
||||
// /VERYSILENT: nessuna interfaccia
|
||||
// /SUPPRESSMSGBOXES: nessun popup
|
||||
// /NORESTART: non riavvia il PC
|
||||
await Process.start(
|
||||
installerFile.path,
|
||||
['/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART'],
|
||||
mode: ProcessStartMode.detached,
|
||||
);
|
||||
|
||||
// Chiude l'applicazione per consentire la sostituzione dei file
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/// Gestione aggiornamento Linux (AppImage in-place)
|
||||
static Future<void> _updateLinux(
|
||||
String downloadUrl,
|
||||
void Function(double progress, String status) onProgress,
|
||||
) async {
|
||||
final currentAppImagePath = Platform.environment['APPIMAGE'];
|
||||
if (currentAppImagePath == null) {
|
||||
throw StateError(
|
||||
"L'applicazione non è in esecuzione come AppImage.",
|
||||
);
|
||||
}
|
||||
|
||||
final newAppImageFile = File('$currentAppImagePath.new');
|
||||
if (newAppImageFile.existsSync()) {
|
||||
try {
|
||||
newAppImageFile.deleteSync();
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
onProgress(0.0, "Download nuova versione in corso...");
|
||||
await _downloadFile(downloadUrl, newAppImageFile, onProgress);
|
||||
|
||||
onProgress(1.0, "Finalizzazione e riavvio...");
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
|
||||
// Assegna il permesso di esecuzione
|
||||
await Process.run('chmod', ['+x', newAppImageFile.path]);
|
||||
|
||||
// Sostituzione atomica del vecchio file AppImage con il nuovo
|
||||
newAppImageFile.renameSync(currentAppImagePath);
|
||||
|
||||
// Rilancia la nuova versione
|
||||
await Process.start(
|
||||
currentAppImagePath,
|
||||
[],
|
||||
mode: ProcessStartMode.detached,
|
||||
);
|
||||
|
||||
// Termina il processo attuale
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/// Download in streaming con tracciamento del progresso
|
||||
static Future<void> _downloadFile(
|
||||
String url,
|
||||
File destinationFile,
|
||||
void Function(double progress, String status) onProgress,
|
||||
) async {
|
||||
final client = HttpClient();
|
||||
client.autoUncompress = true;
|
||||
|
||||
try {
|
||||
final uri = Uri.parse(url);
|
||||
final request = await client.getUrl(uri);
|
||||
final response = await request.close();
|
||||
|
||||
if (response.statusCode < 200 || response.statusCode >= 300) {
|
||||
throw HttpException(
|
||||
'Download fallito con codice di stato ${response.statusCode}',
|
||||
uri: uri,
|
||||
);
|
||||
}
|
||||
|
||||
final contentLength = response.contentLength;
|
||||
int downloadedBytes = 0;
|
||||
|
||||
final sink = destinationFile.openWrite();
|
||||
|
||||
await for (final chunk in response) {
|
||||
sink.add(chunk);
|
||||
downloadedBytes += chunk.length;
|
||||
|
||||
if (contentLength > 0) {
|
||||
final progress = (downloadedBytes / contentLength).clamp(0.0, 1.0);
|
||||
final percent = (progress * 100).toStringAsFixed(0);
|
||||
final downloadedMb =
|
||||
(downloadedBytes / (1024 * 1024)).toStringAsFixed(1);
|
||||
final totalMb = (contentLength / (1024 * 1024)).toStringAsFixed(1);
|
||||
|
||||
onProgress(
|
||||
progress,
|
||||
'Scaricamento: $percent% ($downloadedMb MB di $totalMb MB)',
|
||||
);
|
||||
} else {
|
||||
final downloadedMb =
|
||||
(downloadedBytes / (1024 * 1024)).toStringAsFixed(1);
|
||||
onProgress(0.5, 'Scaricamento in corso ($downloadedMb MB)...');
|
||||
}
|
||||
}
|
||||
|
||||
await sink.flush();
|
||||
await sink.close();
|
||||
} finally {
|
||||
client.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,282 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flux/core/utils/auto_update_service.dart';
|
||||
import 'package:flux/core/utils/version_check_service.dart';
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class UpdatePromptHelper {
|
||||
/// Avvia una verifica manuale degli aggiornamenti con feedback visivo immediato
|
||||
static Future<void> showManualUpdateCheck(BuildContext context) async {
|
||||
// Feedback immediato tramite SnackBar
|
||||
final messenger = ScaffoldMessenger.of(context);
|
||||
messenger.hideCurrentSnackBar();
|
||||
messenger.showSnackBar(
|
||||
const SnackBar(
|
||||
content: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 16,
|
||||
height: 16,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 12),
|
||||
Text("Verifica aggiornamenti in corso..."),
|
||||
],
|
||||
),
|
||||
duration: Duration(seconds: 2),
|
||||
),
|
||||
);
|
||||
|
||||
try {
|
||||
final currentVersion = await VersionCheckService.getShortVersionString();
|
||||
final updateInfo = await VersionCheckService().checkUpdate();
|
||||
|
||||
if (!context.mounted) return;
|
||||
messenger.hideCurrentSnackBar();
|
||||
|
||||
if (updateInfo != null && updateInfo.hasUpdate) {
|
||||
// Nuova versione disponibile: mostra il dialog informativo e di azione
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: !updateInfo.isMandatory,
|
||||
builder: (dialogContext) => _ManualUpdateDialog(
|
||||
updateInfo: updateInfo,
|
||||
currentVersion: currentVersion,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Nessun aggiornamento: l'app è già all'ultima versione
|
||||
messenger.showSnackBar(
|
||||
SnackBar(
|
||||
backgroundColor: Colors.green.shade700,
|
||||
content: Row(
|
||||
children: [
|
||||
const Icon(Icons.check_circle_outline, color: Colors.white),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Flux è aggiornato all'ultima versione disponibile ($currentVersion).",
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
duration: const Duration(seconds: 4),
|
||||
),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
if (!context.mounted) return;
|
||||
messenger.hideCurrentSnackBar();
|
||||
messenger.showSnackBar(
|
||||
SnackBar(
|
||||
backgroundColor: Colors.red.shade700,
|
||||
content: Row(
|
||||
children: [
|
||||
const Icon(Icons.error_outline, color: Colors.white),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Impossibile verificare gli aggiornamenti: $e",
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
duration: const Duration(seconds: 4),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class _ManualUpdateDialog extends StatefulWidget {
|
||||
final UpdateInfo updateInfo;
|
||||
final String currentVersion;
|
||||
|
||||
const _ManualUpdateDialog({
|
||||
required this.updateInfo,
|
||||
required this.currentVersion,
|
||||
});
|
||||
|
||||
@override
|
||||
State<_ManualUpdateDialog> createState() => _ManualUpdateDialogState();
|
||||
}
|
||||
|
||||
class _ManualUpdateDialogState extends State<_ManualUpdateDialog> {
|
||||
bool _isUpdating = false;
|
||||
double _downloadProgress = 0.0;
|
||||
String _statusMessage = "";
|
||||
String? _errorMessage;
|
||||
|
||||
Future<void> _startUpdate() async {
|
||||
setState(() {
|
||||
_isUpdating = true;
|
||||
_errorMessage = null;
|
||||
_downloadProgress = 0.0;
|
||||
_statusMessage = "Avvio aggiornamento...";
|
||||
});
|
||||
|
||||
try {
|
||||
await AutoUpdateService.downloadAndApplyUpdate(
|
||||
downloadUrl: widget.updateInfo.downloadUrl,
|
||||
onProgress: (progress, status) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_downloadProgress = progress;
|
||||
_statusMessage = status;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isUpdating = false;
|
||||
_errorMessage = "Errore durante l'aggiornamento: $e";
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final updateInfo = widget.updateInfo;
|
||||
|
||||
return AlertDialog(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
title: Row(
|
||||
children: [
|
||||
Icon(
|
||||
updateInfo.isMandatory
|
||||
? Icons.warning_amber_rounded
|
||||
: (kIsWeb ? Icons.cached : Icons.system_update),
|
||||
color: updateInfo.isMandatory ? Colors.amber[700] : Colors.blue,
|
||||
size: 28,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
updateInfo.isMandatory
|
||||
? "Aggiornamento Obbligatorio"
|
||||
: "Nuova Versione Disponibile",
|
||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
content: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 400),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
style: const TextStyle(fontSize: 14),
|
||||
children: [
|
||||
const TextSpan(text: "Versione installata: "),
|
||||
TextSpan(
|
||||
text: widget.currentVersion,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const TextSpan(text: "\nNuova versione disponibile: "),
|
||||
TextSpan(
|
||||
text: "v${updateInfo.latestVersion}",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
kIsWeb
|
||||
? "È stata rilasciata una nuova versione. Ricarica la pagina per applicarla."
|
||||
: (updateInfo.isMandatory
|
||||
? "La versione attuale non è più supportata. Aggiorna all'ultima versione per continuare a lavorare."
|
||||
: "Vuoi scaricare e installare l'aggiornamento adesso?"),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.colorScheme.onSurface.withValues(alpha: 0.8),
|
||||
),
|
||||
),
|
||||
if (_errorMessage != null) ...[
|
||||
const SizedBox(height: 16),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: Colors.red.withValues(alpha: 0.3)),
|
||||
),
|
||||
child: Text(
|
||||
_errorMessage!,
|
||||
style: const TextStyle(color: Colors.red, fontSize: 13),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (_isUpdating) ...[
|
||||
const SizedBox(height: 16),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: LinearProgressIndicator(
|
||||
value: _downloadProgress > 0 ? _downloadProgress : null,
|
||||
minHeight: 8,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
_statusMessage,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.onSurface.withValues(alpha: 0.7),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: _isUpdating
|
||||
? []
|
||||
: [
|
||||
if (!updateInfo.isMandatory)
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text("PIÙ TARDI"),
|
||||
),
|
||||
if (kIsWeb)
|
||||
FilledButton.icon(
|
||||
icon: const Icon(Icons.refresh),
|
||||
label: const Text("RICARICA ORA"),
|
||||
onPressed: () {
|
||||
html.window.location.reload();
|
||||
},
|
||||
)
|
||||
else if (AutoUpdateService.isAutoUpdateSupported)
|
||||
FilledButton.icon(
|
||||
icon: const Icon(Icons.system_update_alt),
|
||||
label: const Text("AGGIORNA ORA"),
|
||||
onPressed: _startUpdate,
|
||||
)
|
||||
else
|
||||
FilledButton.icon(
|
||||
icon: const Icon(Icons.open_in_browser),
|
||||
label: const Text("SCARICA"),
|
||||
onPressed: () async {
|
||||
final url = Uri.parse(updateInfo.downloadUrl);
|
||||
await launchUrl(url, mode: LaunchMode.externalApplication);
|
||||
if (context.mounted) Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,46 +3,86 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
enum UpdateType {
|
||||
none,
|
||||
optional,
|
||||
mandatory,
|
||||
}
|
||||
|
||||
class UpdateInfo {
|
||||
final UpdateType type;
|
||||
final String latestVersion;
|
||||
final String minVersion;
|
||||
final String downloadUrl;
|
||||
|
||||
const UpdateInfo({
|
||||
required this.type,
|
||||
required this.latestVersion,
|
||||
required this.minVersion,
|
||||
required this.downloadUrl,
|
||||
});
|
||||
|
||||
bool get isMandatory => type == UpdateType.mandatory;
|
||||
bool get isOptional => type == UpdateType.optional;
|
||||
bool get hasUpdate => type != UpdateType.none;
|
||||
}
|
||||
|
||||
class VersionCheckService {
|
||||
Future<String?> checkForceUpdate() async {
|
||||
Future<UpdateInfo?> checkUpdate() async {
|
||||
try {
|
||||
// 1. Capiamo su che piattaforma sta girando l'app in questo istante
|
||||
String currentPlatform = _getCurrentPlatform();
|
||||
final platformAliases = _getPlatformAliases();
|
||||
|
||||
// 2. Recuperiamo SOLO la riga corrispondente alla nostra piattaforma
|
||||
final dbResponse = await Supabase.instance.client
|
||||
.from('app_config')
|
||||
.select('min_version, download_url')
|
||||
.eq('platform', currentPlatform)
|
||||
.maybeSingle(); // Usiamo maybeSingle così se non c'è la riga non crasha
|
||||
.select('platform, min_version, latest_version, download_url');
|
||||
|
||||
if (dbResponse == null) {
|
||||
return null; // Nessuna regola per questa piattaforma
|
||||
if (dbResponse.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String minVersionFromDb = dbResponse['min_version'] as String;
|
||||
String downloadUrl = dbResponse['download_url'] as String;
|
||||
final rows = List<Map<String, dynamic>>.from(dbResponse);
|
||||
final config = rows.firstWhere(
|
||||
(r) {
|
||||
final p = (r['platform'] as String?)?.toLowerCase().trim() ?? '';
|
||||
return platformAliases.any((alias) => alias.toLowerCase() == p);
|
||||
},
|
||||
orElse: () => {},
|
||||
);
|
||||
|
||||
// 3. Recuperiamo la versione locale di Flutter
|
||||
PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||
String localVersionRaw = packageInfo.version;
|
||||
if (config.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 🥷 TRUCCO 1: Pulizia totale dai build number (+37) o tag "v"
|
||||
String cleanLocal = localVersionRaw
|
||||
.split('+')
|
||||
.first
|
||||
.replaceAll('v', '')
|
||||
.trim();
|
||||
String cleanDb = minVersionFromDb
|
||||
.split('+')
|
||||
.first
|
||||
.replaceAll('v', '')
|
||||
.trim();
|
||||
final minVersionRaw = (config['min_version'] as String?) ?? '0.0.0';
|
||||
final latestVersionRaw =
|
||||
(config['latest_version'] as String?) ?? minVersionRaw;
|
||||
final downloadUrl = (config['download_url'] as String?) ?? '';
|
||||
|
||||
// 🥷 TRUCCO 2: Confronto Semantico Reale
|
||||
if (_isVersionLower(current: cleanLocal, minimum: cleanDb)) {
|
||||
// Ritorna il link VERO per questa specifica piattaforma preso dal CSV!
|
||||
return downloadUrl;
|
||||
final packageInfo = await PackageInfo.fromPlatform();
|
||||
final localVersionRaw = packageInfo.version;
|
||||
|
||||
final cleanLocal = _cleanVersion(localVersionRaw);
|
||||
final cleanMin = _cleanVersion(minVersionRaw);
|
||||
final cleanLatest = _cleanVersion(latestVersionRaw);
|
||||
|
||||
// Se la versione locale è inferiore alla minima ammessa -> obbligatorio
|
||||
if (_isVersionLower(current: cleanLocal, target: cleanMin)) {
|
||||
return UpdateInfo(
|
||||
type: UpdateType.mandatory,
|
||||
latestVersion: latestVersionRaw,
|
||||
minVersion: minVersionRaw,
|
||||
downloadUrl: downloadUrl,
|
||||
);
|
||||
}
|
||||
|
||||
// Se è >= della minima ma inferiore all'ultima disponibile -> facoltativo
|
||||
if (_isVersionLower(current: cleanLocal, target: cleanLatest)) {
|
||||
return UpdateInfo(
|
||||
type: UpdateType.optional,
|
||||
latestVersion: latestVersionRaw,
|
||||
minVersion: minVersionRaw,
|
||||
downloadUrl: downloadUrl,
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -52,43 +92,70 @@ class VersionCheckService {
|
||||
}
|
||||
}
|
||||
|
||||
// Helper ninja per mappare le piattaforme in base alle stringhe del tuo DB
|
||||
String _getCurrentPlatform() {
|
||||
if (kIsWeb) return 'web';
|
||||
if (Platform.isAndroid) return 'android';
|
||||
if (Platform.isIOS) return 'ios';
|
||||
if (Platform.isWindows) return 'windows';
|
||||
if (Platform.isMacOS) return 'macos';
|
||||
if (Platform.isLinux) return 'linux';
|
||||
return 'unknown';
|
||||
Future<String?> checkForceUpdate() async {
|
||||
final info = await checkUpdate();
|
||||
return info?.isMandatory == true ? info?.downloadUrl : null;
|
||||
}
|
||||
|
||||
// Il motore matematico (resta invariato)
|
||||
bool _isVersionLower({required String current, required String minimum}) {
|
||||
if (current == minimum) return false;
|
||||
static Future<String> getAppVersionString() async {
|
||||
try {
|
||||
final info = await PackageInfo.fromPlatform();
|
||||
return info.buildNumber.isNotEmpty
|
||||
? 'v${info.version}+${info.buildNumber}'
|
||||
: 'v${info.version}';
|
||||
} catch (_) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
List<int> currentParts = current
|
||||
static Future<String> getFullVersionString() => getAppVersionString();
|
||||
|
||||
static Future<String> getShortVersionString() async {
|
||||
try {
|
||||
final info = await PackageInfo.fromPlatform();
|
||||
return 'v${info.version}';
|
||||
} catch (_) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
String _cleanVersion(String raw) {
|
||||
return raw.split('+').first.replaceAll('v', '').trim();
|
||||
}
|
||||
|
||||
List<String> _getPlatformAliases() {
|
||||
if (kIsWeb) return const ['web'];
|
||||
if (Platform.isAndroid) return const ['android'];
|
||||
if (Platform.isIOS) return const ['ios'];
|
||||
if (Platform.isWindows) return const ['windows'];
|
||||
if (Platform.isMacOS) return const ['macos'];
|
||||
if (Platform.isLinux) return const ['AppImage', 'linux'];
|
||||
return const ['unknown'];
|
||||
}
|
||||
|
||||
bool _isVersionLower({required String current, required String target}) {
|
||||
if (current == target) return false;
|
||||
|
||||
final currentParts = current
|
||||
.split('.')
|
||||
.map((e) => int.tryParse(e) ?? 0)
|
||||
.toList();
|
||||
List<int> minParts = minimum
|
||||
final targetParts = target
|
||||
.split('.')
|
||||
.map((e) => int.tryParse(e) ?? 0)
|
||||
.toList();
|
||||
|
||||
while (currentParts.length < 3) {
|
||||
currentParts.add(0);
|
||||
}
|
||||
while (minParts.length < 3) {
|
||||
minParts.add(0);
|
||||
}
|
||||
final maxLength = currentParts.length > targetParts.length
|
||||
? currentParts.length
|
||||
: targetParts.length;
|
||||
|
||||
if (currentParts[0] != minParts[0]) {
|
||||
return currentParts[0] < minParts[0];
|
||||
for (int i = 0; i < maxLength; i++) {
|
||||
final c = i < currentParts.length ? currentParts[i] : 0;
|
||||
final t = i < targetParts.length ? targetParts[i] : 0;
|
||||
if (c != t) {
|
||||
return c < t;
|
||||
}
|
||||
}
|
||||
if (currentParts[1] != minParts[1]) {
|
||||
return currentParts[1] < minParts[1];
|
||||
}
|
||||
return currentParts[2] < minParts[2];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
/// Enum con le festività nazionali italiane
|
||||
enum ItalianHoliday {
|
||||
capodanno(day: 1, month: 1, label: 'Capodanno'),
|
||||
epifania(day: 6, month: 1, label: 'Epifania'),
|
||||
liberazione(day: 25, month: 4, label: 'Festa della Liberazione'),
|
||||
lavoro(day: 1, month: 5, label: 'Festa dei Lavoratori'),
|
||||
repubblica(day: 2, month: 6, label: 'Festa della Repubblica'),
|
||||
ferragosto(day: 15, month: 8, label: 'Ferragosto'),
|
||||
ognissanti(day: 1, month: 11, label: 'Tutti i Santi'),
|
||||
immacolata(day: 8, month: 12, label: 'Immacolata Concezione'),
|
||||
natale(day: 25, month: 12, label: 'Natale'),
|
||||
santoStefano(day: 26, month: 12, label: 'Santo Stefano');
|
||||
|
||||
final int day;
|
||||
final int month;
|
||||
final String label;
|
||||
|
||||
const ItalianHoliday({
|
||||
required this.day,
|
||||
required this.month,
|
||||
required this.label,
|
||||
});
|
||||
|
||||
/// Verifica se una determinata data corrisponde alla festività fissa
|
||||
bool matches(DateTime date) => date.day == day && date.month == month;
|
||||
}
|
||||
|
||||
/// Helper per determinare se un giorno è lavorativo ed effettuare il conteggio dei giorni
|
||||
class WorkingDaysHelper {
|
||||
WorkingDaysHelper._();
|
||||
|
||||
/// Verifica se la data è domenica o festività nazionale italiana (fissa o Pasquetta)
|
||||
static bool isWorkingDay(DateTime date) {
|
||||
// 1. Domenica esclusa
|
||||
if (date.weekday == DateTime.sunday) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2. Festività fisse
|
||||
for (final holiday in ItalianHoliday.values) {
|
||||
if (holiday.matches(date)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Pasquetta (Lunedì dell'Angelo)
|
||||
final easterMonday = calculateEasterMonday(date.year);
|
||||
if (date.year == easterMonday.year &&
|
||||
date.month == easterMonday.month &&
|
||||
date.day == easterMonday.day) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Calcola la data del Lunedì dell'Angelo (Pasquetta) tramite l'algoritmo di Meeus/Jones/Butcher
|
||||
static DateTime calculateEasterMonday(int year) {
|
||||
final a = year % 19;
|
||||
final b = year ~/ 100;
|
||||
final c = year % 100;
|
||||
final d = b ~/ 4;
|
||||
final e = b % 4;
|
||||
final f = (b + 8) ~/ 25;
|
||||
final g = (b - f + 1) ~/ 3;
|
||||
final h = (19 * a + b - d - g + 15) % 30;
|
||||
final i = c ~/ 4;
|
||||
final k = c % 4;
|
||||
final l = (32 + 2 * e + 2 * i - h - k) % 7;
|
||||
final m = (a + 11 * h + 22 * l) ~/ 451;
|
||||
final month = (h + l - 7 * m + 114) ~/ 31;
|
||||
final day = ((h + l - 7 * m + 114) % 31) + 1;
|
||||
|
||||
final easterSunday = DateTime(year, month, day);
|
||||
// Pasquetta è il giorno successivo a Pasqua
|
||||
return easterSunday.add(const Duration(days: 1));
|
||||
}
|
||||
|
||||
/// Conta i giorni lavorativi compresi tra [start] e [end] (inclusi)
|
||||
static int countWorkingDays(DateTime start, DateTime end) {
|
||||
if (start.isAfter(end)) return 0;
|
||||
|
||||
int count = 0;
|
||||
DateTime current = DateTime(start.year, start.month, start.day);
|
||||
final targetEnd = DateTime(end.year, end.month, end.day);
|
||||
|
||||
while (!current.isAfter(targetEnd)) {
|
||||
if (isWorkingDay(current)) {
|
||||
count++;
|
||||
}
|
||||
current = current.add(const Duration(days: 1));
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/// Calcola la ripartizione dei giorni lavorativi per un periodo target:
|
||||
/// - [total]: giorni lavorativi totali del periodo
|
||||
/// - [elapsed]: giorni lavorativi trascorsi fino ad oggi (minimo 1 se il periodo è iniziato)
|
||||
/// - [remaining]: giorni lavorativi rimanenti da oggi (incluso oggi se è giorno lavorativo) a fine periodo
|
||||
static ({int total, int elapsed, int remaining}) calculateWorkingDaysPeriod({
|
||||
required DateTime start,
|
||||
required DateTime end,
|
||||
DateTime? now,
|
||||
}) {
|
||||
final today = now ?? DateTime.now();
|
||||
final cleanToday = DateTime(today.year, today.month, today.day);
|
||||
final cleanStart = DateTime(start.year, start.month, start.day);
|
||||
final cleanEnd = DateTime(end.year, end.month, end.day);
|
||||
|
||||
final total = countWorkingDays(cleanStart, cleanEnd);
|
||||
|
||||
// Se siamo prima dell'inizio del periodo
|
||||
if (cleanToday.isBefore(cleanStart)) {
|
||||
return (total: total, elapsed: 0, remaining: total);
|
||||
}
|
||||
|
||||
// Se siamo oltre la fine del periodo
|
||||
if (cleanToday.isAfter(cleanEnd)) {
|
||||
return (total: total, elapsed: total, remaining: 0);
|
||||
}
|
||||
|
||||
// Siamo all'interno del periodo
|
||||
// Giorni trascorsi: dall'inizio fino a oggi
|
||||
final elapsedDays = countWorkingDays(cleanStart, cleanToday);
|
||||
final remainingDays = countWorkingDays(cleanToday, cleanEnd);
|
||||
|
||||
return (
|
||||
total: total > 0 ? total : 1,
|
||||
elapsed: elapsedDays > 0 ? elapsedDays : 1,
|
||||
remaining: remainingDays > 0 ? remainingDays : 1,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flux/core/utils/update_prompt_helper.dart';
|
||||
import 'package:flux/core/utils/version_check_service.dart';
|
||||
|
||||
class AppVersionLabel extends StatefulWidget {
|
||||
final bool isCollapsed;
|
||||
final bool showIcon;
|
||||
|
||||
const AppVersionLabel({
|
||||
super.key,
|
||||
this.isCollapsed = false,
|
||||
this.showIcon = true,
|
||||
});
|
||||
|
||||
@override
|
||||
State<AppVersionLabel> createState() => _AppVersionLabelState();
|
||||
}
|
||||
|
||||
class _AppVersionLabelState extends State<AppVersionLabel> {
|
||||
String _version = "";
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadVersion();
|
||||
}
|
||||
|
||||
Future<void> _loadVersion() async {
|
||||
final v = await VersionCheckService.getShortVersionString();
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_version = v;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (_version.isEmpty) return const SizedBox.shrink();
|
||||
|
||||
final theme = Theme.of(context);
|
||||
final textMuted = theme.colorScheme.onSurface.withValues(alpha: 0.5);
|
||||
|
||||
if (widget.isCollapsed) {
|
||||
return Tooltip(
|
||||
message: "Flux $_version\nClicca per verificare aggiornamenti",
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
onTap: () => UpdatePromptHelper.showManualUpdateCheck(context),
|
||||
child: Container(
|
||||
height: 36,
|
||||
width: 36,
|
||||
alignment: Alignment.center,
|
||||
child: Icon(
|
||||
Icons.info_outline,
|
||||
size: 16,
|
||||
color: textMuted,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Tooltip(
|
||||
message: "Clicca per verificare se ci sono aggiornamenti",
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
onTap: () => UpdatePromptHelper.showManualUpdateCheck(context),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 6.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (widget.showIcon) ...[
|
||||
Icon(
|
||||
Icons.info_outline,
|
||||
size: 13,
|
||||
color: textMuted,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
],
|
||||
Text(
|
||||
"Flux $_version",
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: textMuted,
|
||||
decoration: TextDecoration.underline,
|
||||
decorationColor: textMuted.withValues(alpha: 0.4),
|
||||
decorationStyle: TextDecorationStyle.dotted,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -19,84 +19,119 @@ class QrUploadDialog extends StatelessWidget {
|
||||
// Usiamo i colori del tema per renderlo coerente col tuo design
|
||||
final theme = Theme.of(context);
|
||||
|
||||
return BlocListener<AttachmentsBloc, AttachmentsState>(
|
||||
listener: (context, state) {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
return BlocConsumer<AttachmentsBloc, AttachmentsState>(
|
||||
listenWhen: (previous, current) =>
|
||||
previous.allFiles.length < current.allFiles.length,
|
||||
child: AlertDialog(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
||||
backgroundColor: theme.colorScheme.surface,
|
||||
title: Column(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.qr_code_scanner,
|
||||
size: 48,
|
||||
color: theme.colorScheme.primary,
|
||||
listener: (context, state) {
|
||||
final newCount = state.allFiles.length;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'File caricato con successo via QR Code! 📄 ($newCount allegati in totale)',
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
content: SizedBox(
|
||||
height: 400,
|
||||
width: 350,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min, // Fondamentale per i dialog
|
||||
children: [
|
||||
const Text(
|
||||
"Inquadra questo codice con la fotocamera del tuo telefono per scattare e caricare i documenti direttamente qui.",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 14, color: Colors.grey),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors
|
||||
.white, // Lo sfondo bianco salva la vita sui temi scuri
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
duration: const Duration(seconds: 2),
|
||||
backgroundColor: Colors.green.shade700,
|
||||
),
|
||||
);
|
||||
},
|
||||
builder: (context, state) {
|
||||
final fileCount = state.allFiles.length;
|
||||
|
||||
return AlertDialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
backgroundColor: theme.colorScheme.surface,
|
||||
title: Column(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.qr_code_scanner,
|
||||
size: 48,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
content: SizedBox(
|
||||
height: 400,
|
||||
width: 350,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min, // Fondamentale per i dialog
|
||||
children: [
|
||||
const Text(
|
||||
"Inquadra questo codice con la fotocamera del tuo telefono per scattare e caricare i documenti direttamente qui.",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 14, color: Colors.grey),
|
||||
),
|
||||
child: QrImageView(
|
||||
data: deepLinkUrl,
|
||||
version: QrVersions.auto,
|
||||
size: 200.0,
|
||||
//Opzionale: puoi metterci il logo di FLUX in mezzo!
|
||||
embeddedImage: const AssetImage('assets/images/logo.png'),
|
||||
embeddedImageStyle: const QrEmbeddedImageStyle(
|
||||
size: Size(40, 40),
|
||||
const SizedBox(height: 24),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors
|
||||
.white, // Lo sfondo bianco salva la vita sui temi scuri
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: QrImageView(
|
||||
data: deepLinkUrl,
|
||||
version: QrVersions.auto,
|
||||
size: 200.0,
|
||||
embeddedImage: const AssetImage(
|
||||
'assets/images/logo.png',
|
||||
),
|
||||
embeddedImageStyle: const QrEmbeddedImageStyle(
|
||||
size: Size(40, 40),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
"In attesa di file...",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.colorScheme.primary,
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
fileCount > 0
|
||||
? Icons.check_circle_outline
|
||||
: Icons.hourglass_empty,
|
||||
size: 18,
|
||||
color: fileCount > 0
|
||||
? Colors.green
|
||||
: theme.colorScheme.primary,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
fileCount > 0
|
||||
? "$fileCount file ricevuti! (In ascolto...)"
|
||||
: "In attesa di file...",
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: fileCount > 0
|
||||
? Colors.green
|
||||
: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const LinearProgressIndicator(), // Per far capire che è "in ascolto"
|
||||
],
|
||||
const SizedBox(height: 8),
|
||||
const LinearProgressIndicator(), // Per far capire che è "in ascolto"
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text(context.l10n.commonClose),
|
||||
),
|
||||
],
|
||||
actionsAlignment: MainAxisAlignment.center,
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text(context.l10n.commonClose),
|
||||
),
|
||||
],
|
||||
actionsAlignment: MainAxisAlignment.center,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -56,6 +56,24 @@ class _SharedAttachmentsSectionState extends State<SharedAttachmentsSection> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadExportDirectory();
|
||||
_syncParentIdIfNeeded();
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant SharedAttachmentsSection oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.parentId != oldWidget.parentId) {
|
||||
_syncParentIdIfNeeded();
|
||||
}
|
||||
}
|
||||
|
||||
void _syncParentIdIfNeeded() {
|
||||
if (widget.parentId != null && widget.parentId!.isNotEmpty) {
|
||||
final attachmentsBloc = context.read<AttachmentsBloc>();
|
||||
if (attachmentsBloc.state.parentId != widget.parentId) {
|
||||
attachmentsBloc.add(ParentEntitySavedEvent(widget.parentId!));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- GESTIONE CARTELLA CITRIX (SOLO DESKTOP) ---
|
||||
@@ -91,9 +109,9 @@ class _SharedAttachmentsSectionState extends State<SharedAttachmentsSection> {
|
||||
// --- SELEZIONE FILE DAL PC/TELEFONO ---
|
||||
Future<void> _pickFiles() async {
|
||||
final attachmentsBloc = context.read<AttachmentsBloc>();
|
||||
String? targetId = attachmentsBloc.state.parentId;
|
||||
String? targetId = attachmentsBloc.state.parentId ?? widget.parentId;
|
||||
|
||||
// 🥷 SE L'ID NON C'È (Nuova Operazione), FORZIAMO IL SALVATAGGIO PREVENTIVO!
|
||||
// 🥷 SE L'ID NON C'È (Nuova Operazione), PROVIAMO IL SALVATAGGIO PREVENTIVO
|
||||
if (targetId == null || targetId.isEmpty) {
|
||||
if (widget.onEnsureEntitySaved != null) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
@@ -103,15 +121,13 @@ class _SharedAttachmentsSectionState extends State<SharedAttachmentsSection> {
|
||||
),
|
||||
);
|
||||
|
||||
// Chiamiamo la funzione passata dal TicketForm/OperationForm
|
||||
targetId = await widget.onEnsureEntitySaved!();
|
||||
}
|
||||
}
|
||||
|
||||
// Se il salvataggio fallisce (es. form non valido), ci fermiamo per evitare file orfani
|
||||
if (targetId == null || targetId.isEmpty) return;
|
||||
|
||||
// Comunichiamo immediatamente al BLoC che l'entità padre è stata salvata e ha un nuovo ID.
|
||||
// Questo eviterà che i file finiscano nei `localFiles` temporanei.
|
||||
if (targetId != null &&
|
||||
targetId.isNotEmpty &&
|
||||
attachmentsBloc.state.parentId != targetId) {
|
||||
attachmentsBloc.add(ParentEntitySavedEvent(targetId));
|
||||
}
|
||||
|
||||
@@ -267,22 +283,35 @@ class _SharedAttachmentsSectionState extends State<SharedAttachmentsSection> {
|
||||
}
|
||||
|
||||
// --- APERTURA VIEWER ---
|
||||
void _openFile(AttachmentModel file) {
|
||||
void _openFile(
|
||||
AttachmentModel file, {
|
||||
List<AttachmentModel>? files,
|
||||
int? initialIndex,
|
||||
}) {
|
||||
// 1. Catturiamo il BLoC dalla pagina corrente prima di navigare
|
||||
final operationFilesBloc = context.read<AttachmentsBloc>();
|
||||
final allFilesList = files ?? operationFilesBloc.state.allFiles;
|
||||
final index = initialIndex ??
|
||||
(allFilesList.isNotEmpty ? allFilesList.indexOf(file) : 0);
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (viewerContext) => BlocProvider.value(
|
||||
value: operationFilesBloc,
|
||||
child: AttachmentViewerScreen(
|
||||
attachment: file,
|
||||
onRename: (newName) {
|
||||
attachments: allFilesList.isNotEmpty ? allFilesList : [file],
|
||||
initialIndex: index >= 0 ? index : 0,
|
||||
onRenameAttachment: (targetFile, newName) {
|
||||
// Spara l'evento al BLoC e lui farà il resto!
|
||||
operationFilesBloc.add(RenameAttachmentEvent(file, newName));
|
||||
operationFilesBloc.add(
|
||||
RenameAttachmentEvent(targetFile, newName),
|
||||
);
|
||||
},
|
||||
onDelete: () {
|
||||
operationFilesBloc.add(DeleteSpecificAttachmentEvent(file));
|
||||
onDeleteAttachment: (targetFile) {
|
||||
operationFilesBloc.add(
|
||||
DeleteSpecificAttachmentEvent(targetFile),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -640,10 +669,10 @@ class _SharedAttachmentsSectionState extends State<SharedAttachmentsSection> {
|
||||
icon: const Icon(Icons.qr_code_scanner),
|
||||
color: theme.colorScheme.primary, // Sempre colorato!
|
||||
onPressed: () async {
|
||||
String? targetId = state.parentId;
|
||||
String? targetId = state.parentId ?? widget.parentId;
|
||||
|
||||
// SE L'ID NON C'È, CHIAMIAMO IL SALVATAGGIO IN BACKGROUND!
|
||||
if (targetId == null) {
|
||||
if (targetId == null || targetId.isEmpty) {
|
||||
if (widget.onEnsureEntitySaved != null) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
@@ -654,12 +683,29 @@ class _SharedAttachmentsSectionState extends State<SharedAttachmentsSection> {
|
||||
),
|
||||
);
|
||||
|
||||
// Aspettiamo che il TicketFormCubit faccia il suo lavoro
|
||||
targetId = await widget.onEnsureEntitySaved!();
|
||||
}
|
||||
}
|
||||
|
||||
// Se fallisce (es. validazione form non passata), ci fermiamo
|
||||
if (targetId == null) return;
|
||||
if (targetId == null || targetId.isEmpty) {
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text(
|
||||
'Salva la scheda prima di generare il QR Code per gli allegati.',
|
||||
),
|
||||
backgroundColor: Colors.orange,
|
||||
),
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!context.mounted) return;
|
||||
|
||||
final attachmentBloc = context.read<AttachmentsBloc>();
|
||||
if (attachmentBloc.state.parentId != targetId) {
|
||||
attachmentBloc.add(ParentEntitySavedEvent(targetId));
|
||||
}
|
||||
|
||||
// GENERAZIONE DEL DEEP LINK AGNOSTICO
|
||||
@@ -672,8 +718,6 @@ class _SharedAttachmentsSectionState extends State<SharedAttachmentsSection> {
|
||||
'https://flux.catelli.it/upload/${state.parentType.name}/$targetId?companyId=$companyId';
|
||||
|
||||
if (context.mounted) {
|
||||
final attachmentBloc = context.read<AttachmentsBloc>();
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => BlocProvider.value(
|
||||
@@ -859,7 +903,11 @@ class _SharedAttachmentsSectionState extends State<SharedAttachmentsSection> {
|
||||
children: [
|
||||
// CARD DEL FILE
|
||||
InkWell(
|
||||
onTap: () => _openFile(file),
|
||||
onTap: () => _openFile(
|
||||
file,
|
||||
files: allFiles,
|
||||
initialIndex: index,
|
||||
),
|
||||
onLongPress: () {
|
||||
// Selezione rapida con long press!
|
||||
context.read<AttachmentsBloc>().add(
|
||||
|
||||
@@ -27,13 +27,26 @@ class SharedModelSection extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final hasModel = modelId != null && modelId!.isNotEmpty;
|
||||
final currentModelId = modelId;
|
||||
final currentModelName = modelName;
|
||||
final hasModelId = currentModelId != null && currentModelId.isNotEmpty;
|
||||
final hasModelName = currentModelName != null && currentModelName.isNotEmpty;
|
||||
final hasModel = hasModelId || hasModelName;
|
||||
|
||||
final String subtitleText;
|
||||
if (hasModelName) {
|
||||
subtitleText = currentModelName;
|
||||
} else if (hasModelId) {
|
||||
subtitleText = 'Modello selezionato';
|
||||
} else {
|
||||
subtitleText = 'Nessun modello selezionato';
|
||||
}
|
||||
|
||||
return ListTile(
|
||||
tileColor: backgroundColor,
|
||||
title: Text(label),
|
||||
subtitle: Text(
|
||||
hasModel ? modelName! : 'Nessun modello selezionato',
|
||||
subtitleText,
|
||||
style: TextStyle(
|
||||
color: hasModel ? null : Colors.grey,
|
||||
fontWeight: hasModel ? FontWeight.bold : FontWeight.normal,
|
||||
@@ -124,8 +137,12 @@ class SharedModelSection extends StatelessWidget {
|
||||
);
|
||||
|
||||
if (newModel != null) {
|
||||
// CHIAMIAMO LA CALLBACK!
|
||||
onModelSelected(newModel.id, newModel.nameWithBrand);
|
||||
final selectedId = newModel.id ?? '';
|
||||
final selectedName =
|
||||
newModel.nameWithBrand.isNotEmpty
|
||||
? newModel.nameWithBrand
|
||||
: newModel.name;
|
||||
onModelSelected(selectedId, selectedName);
|
||||
if (context.mounted) Navigator.pop(modalContext);
|
||||
}
|
||||
},
|
||||
@@ -149,11 +166,12 @@ class SharedModelSection extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
// CHIAMIAMO LA CALLBACK!
|
||||
onModelSelected(
|
||||
deviceModel.id!,
|
||||
deviceModel.nameWithBrand,
|
||||
);
|
||||
final selectedId = deviceModel.id ?? '';
|
||||
final selectedName =
|
||||
deviceModel.nameWithBrand.isNotEmpty
|
||||
? deviceModel.nameWithBrand
|
||||
: deviceModel.name;
|
||||
onModelSelected(selectedId, selectedName);
|
||||
Navigator.pop(modalContext);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -76,11 +76,16 @@ class SharedFilesSection extends StatelessWidget {
|
||||
'https://flux.catelli.it/upload/${state.parentType.name}/$targetId?companyId=$companyId';
|
||||
|
||||
if (context.mounted) {
|
||||
final attachmentBloc =
|
||||
context.read<AttachmentsBloc>();
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => QrUploadDialog(
|
||||
deepLinkUrl: deepLink,
|
||||
title: 'Carica File: $titleNameForUpload',
|
||||
builder: (_) => BlocProvider.value(
|
||||
value: attachmentBloc,
|
||||
child: QrUploadDialog(
|
||||
deepLinkUrl: deepLink,
|
||||
title: 'Carica File: $titleNameForUpload',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,110 +1,191 @@
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flux/core/utils/functions.dart';
|
||||
import 'package:flux/features/attachments/models/attachment_model.dart';
|
||||
import 'package:pdfx/pdfx.dart';
|
||||
import 'package:internet_file/internet_file.dart';
|
||||
|
||||
class AttachmentViewerScreen extends StatefulWidget {
|
||||
final AttachmentModel attachment;
|
||||
final AttachmentModel? attachment;
|
||||
final List<AttachmentModel>? attachments;
|
||||
final int initialIndex;
|
||||
final Function(String newName)? onRename;
|
||||
final Function(AttachmentModel attachment, String newName)? onRenameAttachment;
|
||||
final VoidCallback? onDelete;
|
||||
final Function(AttachmentModel attachment)? onDeleteAttachment;
|
||||
|
||||
const AttachmentViewerScreen({
|
||||
super.key,
|
||||
required this.attachment,
|
||||
this.attachment,
|
||||
this.attachments,
|
||||
this.initialIndex = 0,
|
||||
this.onRename,
|
||||
this.onRenameAttachment,
|
||||
this.onDelete,
|
||||
});
|
||||
this.onDeleteAttachment,
|
||||
}) : assert(
|
||||
attachment != null || (attachments != null && attachments.length > 0),
|
||||
'Devi fornire un allegato o una lista di allegati non vuota.',
|
||||
);
|
||||
|
||||
@override
|
||||
State<AttachmentViewerScreen> createState() => _AttachmentViewerScreenState();
|
||||
}
|
||||
|
||||
class _AttachmentViewerScreenState extends State<AttachmentViewerScreen> {
|
||||
late List<AttachmentModel> _items;
|
||||
late int _currentIndex;
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
|
||||
PdfControllerPinch? _pdfController;
|
||||
bool _isLoading = true;
|
||||
String? _errorMessage;
|
||||
Uint8List? _fileBytes;
|
||||
late String _fileName;
|
||||
int _loadToken = 0;
|
||||
|
||||
bool get isPdf => widget.attachment.extension.toLowerCase() == 'pdf';
|
||||
AttachmentModel get _currentAttachment => _items[_currentIndex];
|
||||
bool get isPdf =>
|
||||
_currentAttachment.extension.toLowerCase().replaceAll('.', '') == 'pdf';
|
||||
bool get hasMultipleFiles => _items.length > 1;
|
||||
bool get canGoPrevious => _currentIndex > 0;
|
||||
bool get canGoNext => _currentIndex < _items.length - 1;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_fileName = widget.attachment.name;
|
||||
_loadFile();
|
||||
}
|
||||
|
||||
Future<void> _loadFile() async {
|
||||
try {
|
||||
// 1. Capiamo da dove prendere i dati
|
||||
if (widget.attachment.localBytes != null) {
|
||||
_fileBytes = widget.attachment.localBytes;
|
||||
} else if (widget.attachment.storagePath != null &&
|
||||
widget.attachment.storagePath!.isNotEmpty) {
|
||||
final signedUrl = await getSignedUrl(widget.attachment.storagePath!);
|
||||
_fileBytes = await InternetFile.get(signedUrl);
|
||||
} else {
|
||||
throw Exception("Nessun documento trovato o byte mancanti.");
|
||||
}
|
||||
|
||||
// 2. Se è PDF, inizializziamo il controller
|
||||
if (isPdf && _fileBytes != null) {
|
||||
_pdfController = PdfControllerPinch(
|
||||
document: PdfDocument.openData(_fileBytes!),
|
||||
);
|
||||
}
|
||||
|
||||
if (mounted) setState(() => _isLoading = false);
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
_errorMessage = e.toString();
|
||||
});
|
||||
}
|
||||
if (widget.attachments != null && widget.attachments!.isNotEmpty) {
|
||||
_items = List<AttachmentModel>.from(widget.attachments!);
|
||||
_currentIndex = widget.initialIndex.clamp(0, _items.length - 1);
|
||||
} else if (widget.attachment != null) {
|
||||
_items = [widget.attachment!];
|
||||
_currentIndex = 0;
|
||||
} else {
|
||||
_items = [];
|
||||
_currentIndex = 0;
|
||||
}
|
||||
|
||||
_loadFile();
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
_focusNode.requestFocus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_focusNode.dispose();
|
||||
_pdfController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _goToPrevious() {
|
||||
if (!canGoPrevious) return;
|
||||
_changeFile(_currentIndex - 1);
|
||||
}
|
||||
|
||||
void _goToNext() {
|
||||
if (!canGoNext) return;
|
||||
_changeFile(_currentIndex + 1);
|
||||
}
|
||||
|
||||
void _changeFile(int newIndex) {
|
||||
if (newIndex < 0 || newIndex >= _items.length) return;
|
||||
_pdfController?.dispose();
|
||||
_pdfController = null;
|
||||
setState(() {
|
||||
_currentIndex = newIndex;
|
||||
_isLoading = true;
|
||||
_errorMessage = null;
|
||||
_fileBytes = null;
|
||||
});
|
||||
_loadFile();
|
||||
}
|
||||
|
||||
KeyEventResult _handleKeyEvent(FocusNode node, KeyEvent event) {
|
||||
if (event is KeyDownEvent) {
|
||||
if (event.logicalKey == LogicalKeyboardKey.arrowLeft) {
|
||||
if (canGoPrevious) {
|
||||
_goToPrevious();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
} else if (event.logicalKey == LogicalKeyboardKey.arrowRight) {
|
||||
if (canGoNext) {
|
||||
_goToNext();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
}
|
||||
}
|
||||
return KeyEventResult.ignored;
|
||||
}
|
||||
|
||||
Future<void> _loadFile() async {
|
||||
final token = ++_loadToken;
|
||||
final item = _currentAttachment;
|
||||
|
||||
try {
|
||||
Uint8List? bytes;
|
||||
if (item.localBytes != null) {
|
||||
bytes = item.localBytes;
|
||||
} else if (item.storagePath != null &&
|
||||
item.storagePath!.isNotEmpty) {
|
||||
final signedUrl = await getSignedUrl(item.storagePath!);
|
||||
bytes = await InternetFile.get(signedUrl);
|
||||
} else {
|
||||
throw Exception("Nessun documento trovato o byte mancanti.");
|
||||
}
|
||||
|
||||
if (token != _loadToken || !mounted) return;
|
||||
|
||||
PdfControllerPinch? controller;
|
||||
if (isPdf && bytes != null) {
|
||||
controller = PdfControllerPinch(
|
||||
document: PdfDocument.openData(bytes),
|
||||
);
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_fileBytes = bytes;
|
||||
_pdfController = controller;
|
||||
_isLoading = false;
|
||||
});
|
||||
} catch (e) {
|
||||
if (token != _loadToken || !mounted) return;
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
_errorMessage = e.toString();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _showRenameDialog() {
|
||||
final ctrl = TextEditingController(text: _fileName);
|
||||
final current = _currentAttachment;
|
||||
final ctrl = TextEditingController(text: current.name);
|
||||
ctrl.selection = TextSelection(
|
||||
baseOffset: 0,
|
||||
extentOffset: ctrl.text.length,
|
||||
);
|
||||
final focusNode = FocusNode();
|
||||
final dialogFocusNode = FocusNode();
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
WidgetsBinding.instance.addPostFrameCallback(
|
||||
(_) => focusNode.requestFocus(),
|
||||
(_) => dialogFocusNode.requestFocus(),
|
||||
);
|
||||
return AlertDialog(
|
||||
title: const Text('Rinomina File'),
|
||||
content: TextField(
|
||||
controller: ctrl,
|
||||
focusNode: focusNode,
|
||||
focusNode: dialogFocusNode,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Nuovo nome',
|
||||
suffixText: '.${widget.attachment.extension}',
|
||||
suffixText: '.${current.extension}',
|
||||
),
|
||||
onSubmitted: (val) {
|
||||
Navigator.pop(context);
|
||||
if (val.trim().isNotEmpty && widget.onRename != null) {
|
||||
setState(() {
|
||||
_fileName = val.trim();
|
||||
});
|
||||
widget.onRename!(val.trim());
|
||||
}
|
||||
_applyRename(val);
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
@@ -115,73 +196,141 @@ class _AttachmentViewerScreenState extends State<AttachmentViewerScreen> {
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
if (ctrl.text.trim().isNotEmpty && widget.onRename != null) {
|
||||
setState(() {
|
||||
_fileName = ctrl.text.trim();
|
||||
});
|
||||
widget.onRename!(ctrl.text.trim());
|
||||
}
|
||||
_applyRename(ctrl.text);
|
||||
},
|
||||
child: const Text('Salva'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
).then((_) {
|
||||
if (mounted) {
|
||||
_focusNode.requestFocus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _applyRename(String val) {
|
||||
final trimmed = val.trim();
|
||||
if (trimmed.isEmpty) return;
|
||||
final current = _currentAttachment;
|
||||
final updated = current.copyWith(name: trimmed);
|
||||
setState(() {
|
||||
_items[_currentIndex] = updated;
|
||||
});
|
||||
widget.onRenameAttachment?.call(current, trimmed);
|
||||
widget.onRename?.call(trimmed);
|
||||
}
|
||||
|
||||
void _confirmDelete() {
|
||||
final current = _currentAttachment;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (c) => AlertDialog(
|
||||
title: const Text('Eliminare file?'),
|
||||
content: const Text(
|
||||
'Sei sicuro di voler eliminare questo allegato?',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(c),
|
||||
child: const Text('Annulla'),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(c); // Chiude dialog
|
||||
widget.onDeleteAttachment?.call(current);
|
||||
widget.onDelete?.call();
|
||||
Navigator.pop(context); // Chiude il viewer
|
||||
},
|
||||
child: const Text('Elimina'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black87, // Sfondo scuro per i viewer è il top
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.black,
|
||||
foregroundColor: Colors.white,
|
||||
title: Text(_fileName, style: const TextStyle(fontSize: 16)),
|
||||
actions: [
|
||||
if (widget.onRename != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.edit),
|
||||
tooltip: 'Rinomina',
|
||||
onPressed: _showRenameDialog,
|
||||
return Focus(
|
||||
focusNode: _focusNode,
|
||||
autofocus: true,
|
||||
onKeyEvent: _handleKeyEvent,
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.black87,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.black,
|
||||
foregroundColor: Colors.white,
|
||||
title: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
_currentAttachment.name,
|
||||
style: const TextStyle(fontSize: 16),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
if (hasMultipleFiles)
|
||||
Text(
|
||||
'${_currentIndex + 1} di ${_items.length}',
|
||||
style: const TextStyle(fontSize: 12, color: Colors.white70),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
if (widget.onRename != null || widget.onRenameAttachment != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.edit),
|
||||
tooltip: 'Rinomina',
|
||||
onPressed: _showRenameDialog,
|
||||
),
|
||||
if (widget.onDelete != null || widget.onDeleteAttachment != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete, color: Colors.redAccent),
|
||||
tooltip: 'Elimina',
|
||||
onPressed: _confirmDelete,
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: _buildBody(),
|
||||
),
|
||||
if (widget.onDelete != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete, color: Colors.redAccent),
|
||||
tooltip: 'Elimina',
|
||||
onPressed: () {
|
||||
// Chiediamo conferma
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (c) => AlertDialog(
|
||||
title: const Text('Eliminare file?'),
|
||||
content: const Text(
|
||||
'Sei sicuro di voler eliminare questo allegato?',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(c),
|
||||
child: const Text('Annulla'),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(c); // Chiude dialog
|
||||
widget.onDelete!(); // Lancia eliminazione
|
||||
Navigator.pop(context); // Chiude il viewer
|
||||
},
|
||||
child: const Text('Elimina'),
|
||||
),
|
||||
],
|
||||
// Freccia Precedente
|
||||
if (hasMultipleFiles && canGoPrevious)
|
||||
Positioned(
|
||||
left: 16,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
child: Center(
|
||||
child: _NavigationArrowButton(
|
||||
icon: Icons.arrow_back_ios_new_rounded,
|
||||
tooltip: 'File precedente (←)',
|
||||
onPressed: _goToPrevious,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Freccia Successivo
|
||||
if (hasMultipleFiles && canGoNext)
|
||||
Positioned(
|
||||
right: 16,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
child: Center(
|
||||
child: _NavigationArrowButton(
|
||||
icon: Icons.arrow_forward_ios_rounded,
|
||||
tooltip: 'File successivo (→)',
|
||||
onPressed: _goToNext,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: _buildBody(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -218,3 +367,41 @@ class _AttachmentViewerScreenState extends State<AttachmentViewerScreen> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class _NavigationArrowButton extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final String tooltip;
|
||||
final VoidCallback onPressed;
|
||||
|
||||
const _NavigationArrowButton({
|
||||
required this.icon,
|
||||
required this.tooltip,
|
||||
required this.onPressed,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Tooltip(
|
||||
message: tooltip,
|
||||
child: Material(
|
||||
color: Colors.black.withValues(alpha: 0.55),
|
||||
shape: const CircleBorder(),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
elevation: 6,
|
||||
child: InkWell(
|
||||
onTap: onPressed,
|
||||
hoverColor: Colors.white.withValues(alpha: 0.2),
|
||||
splashColor: Colors.white.withValues(alpha: 0.3),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Icon(
|
||||
icon,
|
||||
color: Colors.white,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/features/home/dashboard_expiring_contracts/bloc/dashboard_expiring_contracts_state.dart';
|
||||
import 'package:flux/features/operations/data/operations_repository.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
class DashboardExpiringContractsCubit
|
||||
extends Cubit<DashboardExpiringContractsState> {
|
||||
final OperationsRepository _repository =
|
||||
GetIt.I.get<OperationsRepository>();
|
||||
final String? companyId;
|
||||
final String? storeId;
|
||||
StreamSubscription<void>? _operationsSubscription;
|
||||
Timer? _pollingTimer;
|
||||
|
||||
DashboardExpiringContractsCubit({
|
||||
required this.companyId,
|
||||
required this.storeId,
|
||||
}) : super(const DashboardExpiringContractsState());
|
||||
|
||||
void startListening() {
|
||||
emit(state.copyWith(status: DashboardExpiringContractsStatus.loading));
|
||||
stopListening();
|
||||
|
||||
_loadExpiringSilently();
|
||||
|
||||
_operationsSubscription = _repository.onOperationsChanged.listen((_) {
|
||||
_loadExpiringSilently();
|
||||
});
|
||||
|
||||
_pollingTimer = Timer.periodic(const Duration(seconds: 30), (_) {
|
||||
_loadExpiringSilently();
|
||||
});
|
||||
}
|
||||
|
||||
void stopListening() {
|
||||
_operationsSubscription?.cancel();
|
||||
_operationsSubscription = null;
|
||||
_pollingTimer?.cancel();
|
||||
_pollingTimer = null;
|
||||
}
|
||||
|
||||
void refresh() {
|
||||
_loadExpiringSilently();
|
||||
}
|
||||
|
||||
void _loadExpiringSilently() async {
|
||||
try {
|
||||
if (companyId == null || companyId!.isEmpty) return;
|
||||
final expiringOps = await _repository.fetchExpiringOperations(
|
||||
companyId: companyId!,
|
||||
storeId: storeId,
|
||||
limit: 20,
|
||||
);
|
||||
if (isClosed) return;
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: DashboardExpiringContractsStatus.success,
|
||||
operations: expiringOps,
|
||||
error: null,
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
if (isClosed) return;
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: DashboardExpiringContractsStatus.failure,
|
||||
error: e.toString(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
stopListening();
|
||||
return super.close();
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flux/features/operations/models/operation_model.dart';
|
||||
|
||||
enum DashboardExpiringContractsStatus { initial, loading, success, failure }
|
||||
|
||||
class DashboardExpiringContractsState extends Equatable {
|
||||
final DashboardExpiringContractsStatus status;
|
||||
final List<OperationModel> operations;
|
||||
final String? error;
|
||||
|
||||
const DashboardExpiringContractsState({
|
||||
this.status = DashboardExpiringContractsStatus.initial,
|
||||
this.operations = const [],
|
||||
this.error,
|
||||
});
|
||||
|
||||
DashboardExpiringContractsState copyWith({
|
||||
DashboardExpiringContractsStatus? status,
|
||||
List<OperationModel>? operations,
|
||||
String? error,
|
||||
}) {
|
||||
return DashboardExpiringContractsState(
|
||||
status: status ?? this.status,
|
||||
operations: operations ?? this.operations,
|
||||
error: error,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [status, operations, error];
|
||||
}
|
||||
+292
@@ -0,0 +1,292 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/routes/routes.dart';
|
||||
import 'package:flux/core/theme/theme.dart';
|
||||
import 'package:flux/core/utils/extensions.dart';
|
||||
import 'package:flux/features/home/dashboard_expiring_contracts/bloc/dashboard_expiring_contracts_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_expiring_contracts/bloc/dashboard_expiring_contracts_state.dart';
|
||||
import 'package:flux/features/operations/data/operations_repository.dart';
|
||||
import 'package:flux/features/operations/models/operation_model.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class DashboardExpiringContractsCard extends StatelessWidget {
|
||||
const DashboardExpiringContractsCard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return _ExpiringContractsCardContent();
|
||||
}
|
||||
}
|
||||
|
||||
class _ExpiringContractsCardContent extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
const color = Colors.orange;
|
||||
|
||||
return Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side: BorderSide(color: theme.dividerColor.withValues(alpha: 0.3)),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () => context.pushNamed(Routes.operations),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// --- HEADER DELLA CARD ---
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.event_repeat_outlined,
|
||||
color: color,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.l10n.homeExpiringContracts,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
color: context.primaryText,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// --- LISTA OPERAZIONI IN SCADENZA ---
|
||||
Expanded(
|
||||
child: BlocBuilder<DashboardExpiringContractsCubit,
|
||||
DashboardExpiringContractsState>(
|
||||
builder: (context, state) {
|
||||
if (state.status ==
|
||||
DashboardExpiringContractsStatus.loading ||
|
||||
state.status ==
|
||||
DashboardExpiringContractsStatus.initial) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
|
||||
if (state.status ==
|
||||
DashboardExpiringContractsStatus.failure) {
|
||||
return Center(
|
||||
child: Text(
|
||||
"Errore di caricamento",
|
||||
style: TextStyle(color: theme.colorScheme.error),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (state.operations.isEmpty) {
|
||||
return Center(
|
||||
child: Text(
|
||||
"Nessun contratto in scadenza.",
|
||||
style: TextStyle(
|
||||
color: context.secondaryText,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ListView.separated(
|
||||
itemCount: state.operations.length,
|
||||
separatorBuilder: (context, index) => Divider(
|
||||
height: 1,
|
||||
color: theme.dividerColor.withValues(alpha: 0.3),
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
final operation = state.operations[index];
|
||||
final earliestExp =
|
||||
OperationsRepository.getEarliestExpiration(operation);
|
||||
final phone = operation.customer?.phoneNumber;
|
||||
|
||||
return InkWell(
|
||||
onTap: () => context.pushNamed(
|
||||
Routes.operationForm,
|
||||
extra: (createdBy: null, operation: operation),
|
||||
pathParameters: {'id': operation.id!},
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// Nome Cliente & note
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
operation.customer?.name ??
|
||||
'Cliente sconosciuto',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: context.primaryText,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
if (operation.attachments.isNotEmpty) ...[
|
||||
const SizedBox(width: 4),
|
||||
Icon(
|
||||
Icons.attach_file,
|
||||
size: 14,
|
||||
color: context.secondaryText,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
if (phone != null && phone.isNotEmpty)
|
||||
Text(
|
||||
phone,
|
||||
style: TextStyle(
|
||||
color: context.secondaryText,
|
||||
fontSize: 11,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(width: 8),
|
||||
|
||||
// Badge Tipo / Subtipo
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: _buildBadges(operation),
|
||||
),
|
||||
|
||||
const SizedBox(width: 8),
|
||||
|
||||
// Data Scadenza Badge
|
||||
_buildExpiryBadge(context, earliestExp),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBadges(OperationModel op) {
|
||||
final labels = op.details
|
||||
.map((d) {
|
||||
final tLabel = d.type?.shortLabel ?? d.type?.value ?? '';
|
||||
final sub = d.subType?.trim() ?? '';
|
||||
if (sub.isNotEmpty) return '$tLabel: $sub';
|
||||
return tLabel;
|
||||
})
|
||||
.where((l) => l.isNotEmpty)
|
||||
.toList();
|
||||
|
||||
if (labels.isEmpty) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
children: labels
|
||||
.map(
|
||||
(label) => Container(
|
||||
margin: const EdgeInsets.only(right: 4),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.amber.withValues(alpha: 0.12),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(
|
||||
color: Colors.amber.withValues(alpha: 0.3),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
color: Colors.amber,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildExpiryBadge(BuildContext context, DateTime? expiry) {
|
||||
if (expiry == null) return const SizedBox.shrink();
|
||||
|
||||
final now = DateTime.now();
|
||||
final differenceDays = expiry.difference(now).inDays;
|
||||
final isExpired = expiry.isBefore(now);
|
||||
|
||||
Color badgeColor = Colors.orange;
|
||||
String text = "${expiry.day}/${expiry.month}/${expiry.year}";
|
||||
|
||||
if (isExpired) {
|
||||
badgeColor = Colors.red;
|
||||
text = "Scaduto ($text)";
|
||||
} else if (differenceDays <= 30) {
|
||||
badgeColor = Colors.redAccent;
|
||||
text = "Tra $differenceDays gg";
|
||||
} else if (differenceDays <= 60) {
|
||||
badgeColor = Colors.orange;
|
||||
text = "Tra ~${(differenceDays / 30).round()} mesi";
|
||||
} else {
|
||||
badgeColor = Colors.blue;
|
||||
text = "${expiry.day}/${expiry.month}/${expiry.year}";
|
||||
}
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: badgeColor.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: badgeColor.withValues(alpha: 0.4)),
|
||||
),
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
color: badgeColor,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -35,10 +35,15 @@ class DashboardNoteListCubit extends Cubit<DashboardNoteListState> {
|
||||
try {
|
||||
_subscription = _repository
|
||||
.notesStream(companyId: companyId!, currentStaffId: staffId!)
|
||||
.listen((_) {
|
||||
// Quando il campanello suona (qualcosa è cambiato a DB), ricarichiamo!
|
||||
_loadNotesSilently();
|
||||
});
|
||||
.listen(
|
||||
(_) {
|
||||
// Quando il campanello suona (qualcosa è cambiato a DB), ricarichiamo!
|
||||
_loadNotesSilently();
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
debugPrint('Dashboard notes stream error: $error');
|
||||
},
|
||||
);
|
||||
} on Exception catch (e) {
|
||||
debugPrint(e.toString());
|
||||
}
|
||||
|
||||
+19
-12
@@ -1,7 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/features/operations/data/operations_repository.dart';
|
||||
import 'package:flux/features/operations/models/operation_model.dart';
|
||||
@@ -15,6 +14,8 @@ class DashboardStoreOperationListCubit
|
||||
final String? companyId;
|
||||
final String? storeId;
|
||||
StreamSubscription<void>? _operationsSubscription;
|
||||
Timer? _pollingTimer;
|
||||
|
||||
DashboardStoreOperationListCubit({
|
||||
required this.companyId,
|
||||
required this.storeId,
|
||||
@@ -31,31 +32,37 @@ class DashboardStoreOperationListCubit
|
||||
// Primo caricamento
|
||||
_loadOperationsSilently();
|
||||
|
||||
// Inizio ascolto campanello
|
||||
try {
|
||||
_operationsSubscription = _repository
|
||||
.watchStoreOperations(storeId: storeId!, limit: 10)
|
||||
.listen((_) {
|
||||
// Quando il campanello suona (qualcosa è cambiato a DB), ricarichiamo!
|
||||
_loadOperationsSilently();
|
||||
});
|
||||
} on Exception catch (e) {
|
||||
debugPrint(e.toString());
|
||||
}
|
||||
// 1. Ascolto notifiche locali di mutazione in memoria (reattività istantanea)
|
||||
_operationsSubscription = _repository.onOperationsChanged.listen((_) {
|
||||
_loadOperationsSilently();
|
||||
});
|
||||
|
||||
// 2. Polling programmato ogni 30 secondi per sincronizzazione di fondo
|
||||
_pollingTimer = Timer.periodic(const Duration(seconds: 30), (_) {
|
||||
_loadOperationsSilently();
|
||||
});
|
||||
}
|
||||
|
||||
void stopListening() {
|
||||
_operationsSubscription?.cancel();
|
||||
_operationsSubscription = null;
|
||||
_pollingTimer?.cancel();
|
||||
_pollingTimer = null;
|
||||
}
|
||||
|
||||
void refresh() {
|
||||
_loadOperationsSilently();
|
||||
}
|
||||
|
||||
void _loadOperationsSilently() async {
|
||||
try {
|
||||
if (companyId == null || storeId == null) return;
|
||||
final paginatedData = await _repository.fetchPaginatedOperations(
|
||||
companyId: companyId!,
|
||||
storeId: storeId!,
|
||||
page: 1,
|
||||
itemsPerPage: 20,
|
||||
onlyShowInDashboard: true,
|
||||
);
|
||||
if (isClosed) return;
|
||||
emit(
|
||||
|
||||
+36
-10
@@ -14,7 +14,9 @@ class DashboardStoreTicketListCubit
|
||||
final TicketRepository _repository = GetIt.I.get<TicketRepository>();
|
||||
final String? companyId;
|
||||
final String? storeId;
|
||||
StreamSubscription<void>? _subscription;
|
||||
StreamSubscription<void>? _realtimeSubscription;
|
||||
StreamSubscription<void>? _localSubscription;
|
||||
Timer? _pollingTimer;
|
||||
|
||||
DashboardStoreTicketListCubit({
|
||||
required this.companyId,
|
||||
@@ -26,8 +28,16 @@ class DashboardStoreTicketListCubit
|
||||
);
|
||||
|
||||
void stopListening() {
|
||||
_subscription?.cancel();
|
||||
_subscription = null;
|
||||
_realtimeSubscription?.cancel();
|
||||
_realtimeSubscription = null;
|
||||
_localSubscription?.cancel();
|
||||
_localSubscription = null;
|
||||
_pollingTimer?.cancel();
|
||||
_pollingTimer = null;
|
||||
}
|
||||
|
||||
void refresh() {
|
||||
_loadTicketsSilently();
|
||||
}
|
||||
|
||||
void startListening() {
|
||||
@@ -38,17 +48,33 @@ class DashboardStoreTicketListCubit
|
||||
// Primo caricamento
|
||||
_loadTicketsSilently();
|
||||
|
||||
// Inizio ascolto campanello
|
||||
// 1. Ascolto notifiche locali di mutazione in memoria (reattività istantanea)
|
||||
_localSubscription = _repository.onTicketsChanged.listen((_) {
|
||||
_loadTicketsSilently();
|
||||
});
|
||||
|
||||
// 2. Ascolto campanello Supabase Realtime (se attivo in DB)
|
||||
try {
|
||||
_subscription = _repository
|
||||
.getLatestStoreTicketsStream(storeId: storeId!, limit: 10)
|
||||
.listen((_) {
|
||||
// Quando il campanello suona (qualcosa è cambiato a DB), ricarichiamo!
|
||||
_loadTicketsSilently();
|
||||
});
|
||||
if (storeId != null && storeId!.isNotEmpty) {
|
||||
_realtimeSubscription = _repository
|
||||
.getLatestStoreTicketsStream(storeId: storeId!, limit: 10)
|
||||
.listen(
|
||||
(_) {
|
||||
_loadTicketsSilently();
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
debugPrint('Realtime store tickets stream error: $error');
|
||||
},
|
||||
);
|
||||
}
|
||||
} on Exception catch (e) {
|
||||
debugPrint(e.toString());
|
||||
}
|
||||
|
||||
// 3. Polling di sicurezza ogni 30 secondi
|
||||
_pollingTimer = Timer.periodic(const Duration(seconds: 30), (_) {
|
||||
_loadTicketsSilently();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _loadTicketsSilently() async {
|
||||
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/features/operations/data/operations_repository.dart';
|
||||
import 'package:flux/features/targets/data/target_progress_service.dart';
|
||||
import 'package:flux/features/targets/data/targets_repository.dart';
|
||||
import 'package:flux/service_locator.dart';
|
||||
import 'dashboard_target_progress_state.dart';
|
||||
|
||||
class DashboardTargetProgressCubit extends Cubit<DashboardTargetProgressState> {
|
||||
final TargetsRepository _targetsRepository = sl<TargetsRepository>();
|
||||
final OperationsRepository _operationsRepository = sl<OperationsRepository>();
|
||||
final TargetProgressService _progressService = sl<TargetProgressService>();
|
||||
|
||||
String? companyId;
|
||||
String? storeId;
|
||||
String? staffId;
|
||||
|
||||
StreamSubscription<void>? _operationsSubscription;
|
||||
StreamSubscription<void>? _targetsSubscription;
|
||||
Timer? _pollingTimer;
|
||||
|
||||
DashboardTargetProgressCubit({
|
||||
this.companyId,
|
||||
this.storeId,
|
||||
this.staffId,
|
||||
}) : super(
|
||||
DashboardTargetProgressState(
|
||||
currentStaffId: staffId,
|
||||
),
|
||||
);
|
||||
|
||||
void updateContext({
|
||||
String? newCompanyId,
|
||||
String? newStoreId,
|
||||
String? newStaffId,
|
||||
}) {
|
||||
bool changed = false;
|
||||
if (newCompanyId != null && newCompanyId != companyId) {
|
||||
companyId = newCompanyId;
|
||||
changed = true;
|
||||
}
|
||||
if (newStoreId != null && newStoreId != storeId) {
|
||||
storeId = newStoreId;
|
||||
changed = true;
|
||||
}
|
||||
if (newStaffId != null && newStaffId != staffId) {
|
||||
staffId = newStaffId;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
emit(state.copyWith(currentStaffId: staffId));
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void startListening() {
|
||||
emit(state.copyWith(status: DashboardTargetProgressStatus.loading));
|
||||
stopListening();
|
||||
|
||||
_loadProgressSilently();
|
||||
|
||||
// 1. Ascolto modifiche delle operazioni in real-time
|
||||
_operationsSubscription =
|
||||
_operationsRepository.onOperationsChanged.listen((_) {
|
||||
_loadProgressSilently();
|
||||
});
|
||||
|
||||
// 2. Ascolto modifiche ai target
|
||||
_targetsSubscription = _targetsRepository.onTargetsChanged.listen((_) {
|
||||
_loadProgressSilently();
|
||||
});
|
||||
|
||||
// 3. Polling leggero ogni 45 secondi
|
||||
_pollingTimer = Timer.periodic(const Duration(seconds: 45), (_) {
|
||||
_loadProgressSilently();
|
||||
});
|
||||
}
|
||||
|
||||
void stopListening() {
|
||||
_operationsSubscription?.cancel();
|
||||
_operationsSubscription = null;
|
||||
_targetsSubscription?.cancel();
|
||||
_targetsSubscription = null;
|
||||
_pollingTimer?.cancel();
|
||||
_pollingTimer = null;
|
||||
}
|
||||
|
||||
void refresh() {
|
||||
_loadProgressSilently();
|
||||
}
|
||||
|
||||
Future<void> _loadProgressSilently() async {
|
||||
if (companyId == null || storeId == null) {
|
||||
if (!isClosed) {
|
||||
emit(state.copyWith(status: DashboardTargetProgressStatus.noTarget));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
final now = DateTime.now();
|
||||
final target = await _targetsRepository.getStoreTargetForMonth(
|
||||
companyId: companyId!,
|
||||
storeId: storeId!,
|
||||
month: now,
|
||||
);
|
||||
|
||||
if (isClosed) return;
|
||||
|
||||
if (target == null) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: DashboardTargetProgressStatus.noTarget,
|
||||
target: null,
|
||||
progress: null,
|
||||
currentStaffId: staffId,
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
final progress = await _progressService.calculateTargetProgress(
|
||||
target: target,
|
||||
now: now,
|
||||
);
|
||||
|
||||
if (isClosed) return;
|
||||
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: DashboardTargetProgressStatus.success,
|
||||
target: target,
|
||||
progress: progress,
|
||||
currentStaffId: staffId,
|
||||
errorMessage: null,
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
if (isClosed) return;
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: DashboardTargetProgressStatus.failure,
|
||||
errorMessage: e.toString(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
stopListening();
|
||||
return super.close();
|
||||
}
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flux/features/targets/models/target_model.dart';
|
||||
import 'package:flux/features/targets/models/target_progress_model.dart';
|
||||
|
||||
enum DashboardTargetProgressStatus {
|
||||
initial,
|
||||
loading,
|
||||
success,
|
||||
noTarget,
|
||||
failure,
|
||||
}
|
||||
|
||||
class DashboardTargetProgressState extends Equatable {
|
||||
final DashboardTargetProgressStatus status;
|
||||
final TargetModel? target;
|
||||
final TargetProgressModel? progress;
|
||||
final String? currentStaffId;
|
||||
final String? errorMessage;
|
||||
|
||||
const DashboardTargetProgressState({
|
||||
this.status = DashboardTargetProgressStatus.initial,
|
||||
this.target,
|
||||
this.progress,
|
||||
this.currentStaffId,
|
||||
this.errorMessage,
|
||||
});
|
||||
|
||||
DashboardTargetProgressState copyWith({
|
||||
DashboardTargetProgressStatus? status,
|
||||
TargetModel? target,
|
||||
TargetProgressModel? progress,
|
||||
String? currentStaffId,
|
||||
String? errorMessage,
|
||||
}) {
|
||||
return DashboardTargetProgressState(
|
||||
status: status ?? this.status,
|
||||
target: target ?? this.target,
|
||||
progress: progress ?? this.progress,
|
||||
currentStaffId: currentStaffId ?? this.currentStaffId,
|
||||
errorMessage: errorMessage,
|
||||
);
|
||||
}
|
||||
|
||||
/// Avanzamento specifico del membro dello staff indicato o correntemente connesso
|
||||
TargetProgressModel? getStaffProgress([String? staffId]) {
|
||||
final curProgress = progress;
|
||||
final id = staffId ?? currentStaffId;
|
||||
if (curProgress == null || id == null) return null;
|
||||
return curProgress.staffProgress[id];
|
||||
}
|
||||
|
||||
/// True se lo staff connesso o specificato ha almeno un target individuale attivo impostato
|
||||
bool hasStaffTargets([String? staffId]) {
|
||||
final sp = getStaffProgress(staffId);
|
||||
if (sp == null) return false;
|
||||
return sp.categories.values.any((c) => c.hasTarget);
|
||||
}
|
||||
|
||||
/// Lista delle categorie con target attivo per l'addetto indicato o connesso
|
||||
List<CategoryProgress> activeStaffCategories([String? staffId]) {
|
||||
final sp = getStaffProgress(staffId);
|
||||
if (sp == null) return const [];
|
||||
return sp.categories.values.where((c) => c.hasTarget).toList();
|
||||
}
|
||||
|
||||
/// Restituisce sempre l'avanzamento personalizzato per lo staff
|
||||
TargetProgressModel getEffectiveStaffProgress({
|
||||
required String? staffId,
|
||||
required String? staffName,
|
||||
}) {
|
||||
final sp = getStaffProgress(staffId);
|
||||
if (sp != null) {
|
||||
return sp;
|
||||
}
|
||||
|
||||
final curProgress = progress;
|
||||
if (curProgress == null) {
|
||||
return TargetProgressModel.empty();
|
||||
}
|
||||
|
||||
// Se l'addetto non è mappato nella lista (es. nuovo addetto senza operazioni),
|
||||
// creiamo una scheda personale con le categorie attive del negozio
|
||||
final staffCount = target?.individualTargets.length ?? 1;
|
||||
final divisor = staffCount > 0 ? staffCount : 1;
|
||||
|
||||
final userCategories = <String, CategoryProgress>{};
|
||||
for (final entry in curProgress.categories.entries) {
|
||||
final storeCat = entry.value;
|
||||
userCategories[entry.key] = CategoryProgress.calculate(
|
||||
key: storeCat.key,
|
||||
label: storeCat.label,
|
||||
actual: 0,
|
||||
s1: (storeCat.targetS1 / divisor).round(),
|
||||
s2: (storeCat.targetS2 / divisor).round(),
|
||||
elapsedDays: curProgress.elapsedWorkingDays,
|
||||
remainingDays: curProgress.remainingWorkingDays,
|
||||
totalDays: curProgress.totalWorkingDays,
|
||||
);
|
||||
}
|
||||
|
||||
return TargetProgressModel(
|
||||
targetId: curProgress.targetId,
|
||||
storeId: curProgress.storeId,
|
||||
staffId: staffId,
|
||||
staffName: staffName,
|
||||
totalWorkingDays: curProgress.totalWorkingDays,
|
||||
elapsedWorkingDays: curProgress.elapsedWorkingDays,
|
||||
remainingWorkingDays: curProgress.remainingWorkingDays,
|
||||
categories: userCategories,
|
||||
);
|
||||
}
|
||||
|
||||
/// Avanzamento specifico del membro dello staff correntemente connesso
|
||||
TargetProgressModel? get currentStaffProgress => getStaffProgress();
|
||||
|
||||
/// Lista delle categorie con target attivo per il negozio
|
||||
List<CategoryProgress> get activeStoreCategories {
|
||||
final curProgress = progress;
|
||||
if (curProgress == null) return const [];
|
||||
return curProgress.categories.values.where((c) => c.hasTarget).toList();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
status,
|
||||
target,
|
||||
progress,
|
||||
currentStaffId,
|
||||
errorMessage,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,895 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/core/routes/routes.dart';
|
||||
import 'package:flux/features/home/dashboard_target_progress/blocs/dashboard_target_progress_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_target_progress/blocs/dashboard_target_progress_state.dart';
|
||||
import 'package:flux/features/master_data/staff/models/staff_member_model.dart';
|
||||
import 'package:flux/features/targets/models/target_progress_model.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class DashboardTargetHeroCard extends StatefulWidget {
|
||||
const DashboardTargetHeroCard({super.key});
|
||||
|
||||
@override
|
||||
State<DashboardTargetHeroCard> createState() =>
|
||||
_DashboardTargetHeroCardState();
|
||||
}
|
||||
|
||||
class _DashboardTargetHeroCardState extends State<DashboardTargetHeroCard> {
|
||||
bool _showAllCategories = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<DashboardTargetProgressCubit,
|
||||
DashboardTargetProgressState>(
|
||||
builder: (context, state) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
if (state.status == DashboardTargetProgressStatus.loading ||
|
||||
state.status == DashboardTargetProgressStatus.initial) {
|
||||
return _buildLoadingCard(theme);
|
||||
}
|
||||
|
||||
if (state.status == DashboardTargetProgressStatus.noTarget ||
|
||||
state.target == null ||
|
||||
state.progress == null) {
|
||||
return _buildNoTargetCard(context, theme);
|
||||
}
|
||||
|
||||
return _buildHeroContent(context, theme, state);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLoadingCard(ThemeData theme) {
|
||||
return Container(
|
||||
height: 160,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(color: theme.dividerColor.withValues(alpha: 0.2)),
|
||||
),
|
||||
child: const Center(
|
||||
child: SizedBox(
|
||||
width: 28,
|
||||
height: 28,
|
||||
child: CircularProgressIndicator(strokeWidth: 2.5),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNoTargetCard(BuildContext context, ThemeData theme) {
|
||||
final currentStore = context.watch<SessionCubit>().state.currentStore;
|
||||
final now = DateTime.now();
|
||||
final months = [
|
||||
'Gennaio',
|
||||
'Febbraio',
|
||||
'Marzo',
|
||||
'Aprile',
|
||||
'Maggio',
|
||||
'Giugno',
|
||||
'Luglio',
|
||||
'Agosto',
|
||||
'Settembre',
|
||||
'Ottobre',
|
||||
'Novembre',
|
||||
'Dicembre'
|
||||
];
|
||||
final monthLabel = '${months[now.month - 1]} ${now.year}';
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.2),
|
||||
width: 1.5,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.04),
|
||||
blurRadius: 16,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.flag_outlined,
|
||||
color: theme.colorScheme.primary,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'Nessun obiettivo per $monthLabel',
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'Imposta i target di ${currentStore?.name ?? "questo negozio"} per monitorare le medie giornaliere richieste e il ritmo di vendita.',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
FilledButton.icon(
|
||||
onPressed: () => context.pushNamed(Routes.targets),
|
||||
icon: const Icon(Icons.add, size: 18),
|
||||
label: const Text('Imposta Target'),
|
||||
style: FilledButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildHeroContent(
|
||||
BuildContext context,
|
||||
ThemeData theme,
|
||||
DashboardTargetProgressState state,
|
||||
) {
|
||||
final progress = state.progress!;
|
||||
final target = state.target!;
|
||||
final staffMember =
|
||||
context.watch<SessionCubit>().state.currentStaffMember;
|
||||
final currentStore =
|
||||
context.watch<SessionCubit>().state.currentStore;
|
||||
final staffName = staffMember?.name ?? 'Ospite';
|
||||
final staffId = staffMember?.id;
|
||||
|
||||
final isManager = staffMember?.systemRole == SystemRole.manager ||
|
||||
staffMember?.systemRole == SystemRole.admin;
|
||||
|
||||
final activeProgress = isManager
|
||||
? progress
|
||||
: state.getEffectiveStaffProgress(
|
||||
staffId: staffId,
|
||||
staffName: staffName,
|
||||
);
|
||||
|
||||
final displayCategories = activeProgress.categories.values
|
||||
.where((c) => c.hasTarget)
|
||||
.toList();
|
||||
|
||||
final inLineCategories =
|
||||
displayCategories.where((c) => !c.isBehind).toList();
|
||||
final behindCategories =
|
||||
displayCategories.where((c) => c.isBehind).toList();
|
||||
|
||||
final categoriesToDisplay =
|
||||
_showAllCategories ? displayCategories : behindCategories;
|
||||
|
||||
final remainingDays = progress.remainingWorkingDays;
|
||||
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final isCompact = constraints.maxWidth < 600;
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.25),
|
||||
width: 1.5,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.06),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 6),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// ==========================================
|
||||
// 1. HEADER DELLA CARD (TITOLO & GIORNI)
|
||||
// ==========================================
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
isCompact ? 14 : 20,
|
||||
isCompact ? 14 : 18,
|
||||
isCompact ? 14 : 20,
|
||||
isCompact ? 10 : 14,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(isCompact ? 8 : 10),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
theme.colorScheme.primary,
|
||||
theme.colorScheme.primary.withValues(alpha: 0.8),
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: theme.colorScheme.primary
|
||||
.withValues(alpha: 0.25),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Icon(
|
||||
Icons.trending_up_rounded,
|
||||
color: Colors.white,
|
||||
size: isCompact ? 20 : 22,
|
||||
),
|
||||
),
|
||||
SizedBox(width: isCompact ? 10 : 14),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 8,
|
||||
runSpacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
isManager ? 'RITMO NEGOZIO PER OGGI' : 'IL TUO RITMO PER OGGI',
|
||||
style: TextStyle(
|
||||
fontSize: isCompact ? 10.5 : 11,
|
||||
fontWeight: FontWeight.w800,
|
||||
letterSpacing: 0.6,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 7,
|
||||
vertical: 2,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.primaryContainer
|
||||
.withValues(alpha: 0.35),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Text(
|
||||
remainingDays > 1
|
||||
? 'Mancano $remainingDays gg'
|
||||
: (remainingDays == 1
|
||||
? 'Ultimo giorno!'
|
||||
: 'Mese concluso'),
|
||||
style: TextStyle(
|
||||
fontSize: isCompact ? 10 : 11,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
Text(
|
||||
isManager
|
||||
? 'Obiettivi di ${currentStore?.name ?? "Negozio"} per oggi'
|
||||
: (staffMember != null
|
||||
? 'Cosa portare a casa oggi, $staffName'
|
||||
: 'Obiettivi personali per oggi'),
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: isCompact ? 15 : 17,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
// Tasto rapido dettaglio
|
||||
if (isCompact)
|
||||
IconButton(
|
||||
onPressed: () => context.pushNamed(
|
||||
Routes.targetDetail,
|
||||
extra: target,
|
||||
),
|
||||
icon: const Icon(Icons.analytics_outlined),
|
||||
tooltip: 'Dettagli target',
|
||||
color: theme.colorScheme.primary,
|
||||
visualDensity: VisualDensity.compact,
|
||||
)
|
||||
else
|
||||
TextButton.icon(
|
||||
onPressed: () => context.pushNamed(
|
||||
Routes.targetDetail,
|
||||
extra: target,
|
||||
),
|
||||
icon: const Icon(Icons.analytics_outlined, size: 18),
|
||||
label: const Text('Dettagli'),
|
||||
style: TextButton.styleFrom(
|
||||
visualDensity: VisualDensity.compact,
|
||||
foregroundColor: theme.colorScheme.primary,
|
||||
textStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
// ==========================================
|
||||
// 2. FOCUS METRICHE: MEDIE RICHIESTE PER OGGI
|
||||
// ==========================================
|
||||
if (displayCategories.isEmpty)
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
|
||||
child: Text(
|
||||
'Nessun obiettivo attivo configurato per questo mese.',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
)
|
||||
else ...[
|
||||
// Banner sintetico per gli elementi in linea
|
||||
if (inLineCategories.isNotEmpty)
|
||||
_buildInLineSummaryBanner(
|
||||
theme,
|
||||
inLineCategories: inLineCategories,
|
||||
totalCategoriesCount: displayCategories.length,
|
||||
hasBehindCategories: behindCategories.isNotEmpty,
|
||||
isManager: isManager,
|
||||
),
|
||||
|
||||
if (categoriesToDisplay.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: GridView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: categoriesToDisplay.length,
|
||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent:
|
||||
constraints.maxWidth > 700 ? 260 : 200,
|
||||
mainAxisExtent: 168,
|
||||
crossAxisSpacing: 10,
|
||||
mainAxisSpacing: 10,
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
final category = categoriesToDisplay[index];
|
||||
final storeCategory =
|
||||
progress.categories[category.key];
|
||||
return _buildCategoryDailyPacingCard(
|
||||
theme,
|
||||
category,
|
||||
storeCategory: storeCategory,
|
||||
isManager: isManager,
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
else if (behindCategories.isEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20,
|
||||
vertical: 8,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Tutti gli obiettivi sono in linea col ritmo! 🎉',
|
||||
style: TextStyle(
|
||||
fontSize: 12.5,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
const SizedBox(height: 14),
|
||||
|
||||
// ==========================================
|
||||
// 3. SEZIONE INFERIORE: RIEPILOGO NEGOZIO
|
||||
// ==========================================
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surfaceContainerHighest
|
||||
.withValues(alpha: 0.35),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
bottom: Radius.circular(19),
|
||||
),
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
color: theme.dividerColor.withValues(alpha: 0.2),
|
||||
),
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: isCompact ? 14 : 20,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.spaceBetween,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 10,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 6,
|
||||
runSpacing: 4,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.storefront_outlined,
|
||||
size: 17,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
Text(
|
||||
'Negozio:',
|
||||
style: TextStyle(
|
||||
fontSize: 11.5,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: theme.colorScheme.primary,
|
||||
letterSpacing: 0.5,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
// Badge sintetici del negozio
|
||||
_buildMiniBadge(
|
||||
label:
|
||||
'${progress.countAchieved}/${progress.countTotalActive} Presi',
|
||||
color: const Color(0xFF15803D),
|
||||
bgColor: const Color(0xFFDCFCE7),
|
||||
),
|
||||
_buildMiniBadge(
|
||||
label: '${progress.countInLineOnly} In linea',
|
||||
color: const Color(0xFF0D9488),
|
||||
bgColor: const Color(0xFFCCFBF1),
|
||||
),
|
||||
if (progress.countBehind > 0)
|
||||
_buildMiniBadge(
|
||||
label: '${progress.countBehind} Sotto ritmo',
|
||||
color: const Color(0xFFDC2626),
|
||||
bgColor: const Color(0xFFFEE2E2),
|
||||
),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => context.pushNamed(
|
||||
Routes.targetDetail,
|
||||
extra: target,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 4,
|
||||
vertical: 2,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'Apri analisi completa',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Icon(
|
||||
Icons.arrow_forward_rounded,
|
||||
size: 14,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCategoryDailyPacingCard(
|
||||
ThemeData theme,
|
||||
CategoryProgress category, {
|
||||
CategoryProgress? storeCategory,
|
||||
bool isManager = false,
|
||||
}) {
|
||||
final pacingTheme = PacingTheme.of(category.status);
|
||||
final isAchieved = category.isAchieved;
|
||||
final hasS2 = category.targetS2 > 0;
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
border: Border.all(
|
||||
color: pacingTheme.border.withValues(alpha: 0.7),
|
||||
width: 1.2,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: pacingTheme.primary.withValues(alpha: 0.04),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Header tessera: Nome metrica + Pillola di stato
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
category.label.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w800,
|
||||
letterSpacing: 0.3,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: pacingTheme.background,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: pacingTheme.border, width: 0.8),
|
||||
),
|
||||
child: Text(
|
||||
isAchieved
|
||||
? 'Preso! 🎉'
|
||||
: (category.status == TargetPacingStatus.inLineS1 ||
|
||||
category.status == TargetPacingStatus.inLineS2
|
||||
? 'In linea ✅'
|
||||
: (category.status == TargetPacingStatus.recoverable
|
||||
? 'Da spingere ⚡'
|
||||
: 'In ritardo 🔴')),
|
||||
style: TextStyle(
|
||||
fontSize: 9,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: pacingTheme.text,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const Spacer(),
|
||||
|
||||
// Centro: Numero gigante MEDIA GIORNALIERA RICHIESTA PER OGGI
|
||||
if (isAchieved)
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
children: [
|
||||
Text(
|
||||
'RAGGIUNTO',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: pacingTheme.primary,
|
||||
letterSpacing: -0.5,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
const Text('🏆', style: TextStyle(fontSize: 16)),
|
||||
],
|
||||
),
|
||||
if (hasS2 && !category.isAchievedS2)
|
||||
Text(
|
||||
'Sfida (S2): ${category.requiredDailyRateS2.toStringAsFixed(1)} / gg',
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.purple.shade700,
|
||||
),
|
||||
)
|
||||
else
|
||||
Text(
|
||||
isManager
|
||||
? 'Obiettivo negozio centrato!'
|
||||
: 'Obiettivo personale centrato!',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
else
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
children: [
|
||||
Text(
|
||||
category.requiredDailyRateS1.toStringAsFixed(1),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: pacingTheme.text,
|
||||
letterSpacing: -0.5,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'/ giorno',
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: pacingTheme.text.withValues(alpha: 0.8),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (hasS2)
|
||||
Text(
|
||||
'Sfida S2: ${category.requiredDailyRateS2.toStringAsFixed(1)} / gg',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
else
|
||||
Text(
|
||||
'Target: ${category.targetS1} pz',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const Spacer(),
|
||||
|
||||
// Footer: Avanzamento e ritmo
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
isManager
|
||||
? 'Negozio: ${category.actualPieces} / ${category.targetS1}'
|
||||
: 'I tuoi: ${category.actualPieces} / ${category.targetS1}',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'ritmo: ${category.actualDailyRate.toStringAsFixed(1)}/gg',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
child: LinearProgressIndicator(
|
||||
value: category.targetS1 > 0
|
||||
? (category.actualPieces / category.targetS1).clamp(0.0, 1.0)
|
||||
: 0.0,
|
||||
minHeight: 4,
|
||||
backgroundColor: pacingTheme.background,
|
||||
color: pacingTheme.primary,
|
||||
),
|
||||
),
|
||||
if (!isManager && storeCategory != null && storeCategory.targetS1 > 0) ...[
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Negozio: ${storeCategory.actualPieces}/${storeCategory.targetS1}',
|
||||
style: TextStyle(
|
||||
fontSize: 9.5,
|
||||
color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.75),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'ritmo: ${storeCategory.actualDailyRate.toStringAsFixed(1)}/gg',
|
||||
style: TextStyle(
|
||||
fontSize: 9.5,
|
||||
color: theme.colorScheme.onSurfaceVariant.withValues(alpha: 0.75),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInLineSummaryBanner(
|
||||
ThemeData theme, {
|
||||
required List<CategoryProgress> inLineCategories,
|
||||
required int totalCategoriesCount,
|
||||
required bool hasBehindCategories,
|
||||
bool isManager = false,
|
||||
}) {
|
||||
final isDark = theme.brightness == Brightness.dark;
|
||||
final bannerBg = isDark
|
||||
? const Color(0xFF064E3B).withValues(alpha: 0.35)
|
||||
: const Color(0xFFF0FDF4);
|
||||
final bannerBorder = isDark
|
||||
? const Color(0xFF047857).withValues(alpha: 0.5)
|
||||
: const Color(0xFFBBF7D0);
|
||||
final bannerIconColor =
|
||||
isDark ? const Color(0xFF34D399) : const Color(0xFF16A34A);
|
||||
final bannerTextColor =
|
||||
isDark ? const Color(0xFF6EE7B7) : const Color(0xFF15803D);
|
||||
final bannerSubtextColor =
|
||||
isDark ? const Color(0xFFA7F3D0) : const Color(0xFF166534);
|
||||
|
||||
final subjectText = isManager ? 'Il negozio è in linea' : 'Sei in linea';
|
||||
|
||||
final titleText = !hasBehindCategories
|
||||
? '$subjectText con tutti i ${inLineCategories.length} obiettivi! 🎉'
|
||||
: '$subjectText con ${inLineCategories.length} ${inLineCategories.length == 1 ? 'obiettivo' : 'obiettivi'} su $totalCategoriesCount';
|
||||
|
||||
final categoryNames = inLineCategories.map((c) => c.label).join(' • ');
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.fromLTRB(16, 0, 16, 12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: bannerBg,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: bannerBorder, width: 1),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check_circle_rounded,
|
||||
color: bannerIconColor,
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
titleText,
|
||||
style: TextStyle(
|
||||
fontSize: 12.5,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: bannerTextColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
categoryNames,
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: bannerSubtextColor,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_showAllCategories = !_showAllCategories;
|
||||
});
|
||||
},
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
_showAllCategories
|
||||
? 'Nascondi'
|
||||
: 'Mostra tutti (${inLineCategories.length})',
|
||||
style: TextStyle(
|
||||
fontSize: 11.5,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: bannerTextColor,
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
_showAllCategories
|
||||
? Icons.keyboard_arrow_up
|
||||
: Icons.keyboard_arrow_down,
|
||||
size: 16,
|
||||
color: bannerTextColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMiniBadge({
|
||||
required String label,
|
||||
required Color color,
|
||||
required Color bgColor,
|
||||
}) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -29,12 +29,15 @@ class DashboardTaskListCubit extends Cubit<DashboardTaskListState> {
|
||||
|
||||
// Inizio ascolto campanello
|
||||
try {
|
||||
_tasksSubscription = _repository.watchCompanyTasks(companyId!).listen((
|
||||
_,
|
||||
) {
|
||||
// Quando il campanello suona (qualcosa è cambiato a DB), ricarichiamo!
|
||||
_loadTasksSilently();
|
||||
});
|
||||
_tasksSubscription = _repository.watchCompanyTasks(companyId!).listen(
|
||||
(_) {
|
||||
// Quando il campanello suona (qualcosa è cambiato a DB), ricarichiamo!
|
||||
_loadTasksSilently();
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
debugPrint('Dashboard tasks stream error: $error');
|
||||
},
|
||||
);
|
||||
} on Exception catch (e) {
|
||||
debugPrint(e.toString());
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import 'package:flux/core/routes/routes.dart';
|
||||
import 'package:flux/core/theme/theme.dart';
|
||||
import 'package:flux/core/utils/extensions.dart';
|
||||
import 'package:flux/core/widgets/staff_selector_modal.dart';
|
||||
import 'package:flux/features/home/dashboard_expiring_contracts/bloc/dashboard_expiring_contracts_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_expiring_contracts/ui/dashboard_expiring_contracts_card.dart';
|
||||
import 'package:flux/features/home/dashboard_note_list/blocs/dashboard_note_list_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_store_operation_list/bloc/dashboard_store_operation_list_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_store_ticket_list/blocs/dashboard_store_ticket_list_cubit.dart';
|
||||
@@ -19,6 +21,8 @@ import 'package:flux/features/master_data/staff/models/staff_member_model.dart';
|
||||
import 'package:flux/features/notes/data/notes_repository.dart';
|
||||
import 'package:flux/features/notes/models/note_model.dart';
|
||||
import 'package:flux/features/home/dashboard_note_list/ui/dashboard_note_list_card.dart';
|
||||
import 'package:flux/features/home/dashboard_target_progress/blocs/dashboard_target_progress_cubit.dart';
|
||||
import 'package:flux/features/home/dashboard_target_progress/ui/dashboard_target_hero_card.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
@@ -73,13 +77,23 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
context.read<DashboardTaskListCubit>().stopListening();
|
||||
context.read<DashboardStoreTicketListCubit>().stopListening();
|
||||
context.read<DashboardNoteListCubit>().stopListening();
|
||||
context.read<DashboardTargetProgressCubit>().stopListening();
|
||||
context.read<DashboardExpiringContractsCubit>().stopListening();
|
||||
}
|
||||
|
||||
void _startListeners() {
|
||||
final sessionState = context.read<SessionCubit>().state;
|
||||
context.read<DashboardTargetProgressCubit>().updateContext(
|
||||
newCompanyId: sessionState.company?.id,
|
||||
newStoreId: sessionState.currentStore?.id,
|
||||
newStaffId: sessionState.currentStaffMember?.id,
|
||||
);
|
||||
context.read<DashboardStoreOperationListCubit>().startListening();
|
||||
context.read<DashboardTaskListCubit>().startListening();
|
||||
context.read<DashboardStoreTicketListCubit>().startListening();
|
||||
context.read<DashboardNoteListCubit>().startListening();
|
||||
context.read<DashboardTargetProgressCubit>().startListening();
|
||||
context.read<DashboardExpiringContractsCubit>().startListening();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -112,47 +126,63 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
// 2. CORPO DELLA DASHBOARD (Scrollabile)
|
||||
// ==========================================
|
||||
Expanded(
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
// --- QUICK ACTIONS: AZIONI RAPIDE ---
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
child: BlocListener<SessionCubit, SessionState>(
|
||||
listenWhen: (prev, curr) =>
|
||||
prev.currentStore?.id != curr.currentStore?.id ||
|
||||
prev.currentStaffMember?.id != curr.currentStaffMember?.id ||
|
||||
prev.company?.id != curr.company?.id,
|
||||
listener: (context, sessionState) {
|
||||
context.read<DashboardTargetProgressCubit>().updateContext(
|
||||
newCompanyId: sessionState.company?.id,
|
||||
newStoreId: sessionState.currentStore?.id,
|
||||
newStaffId: sessionState.currentStaffMember?.id,
|
||||
);
|
||||
},
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
// --- HERO TARGET DEL GIORNO (TUTTA LARGHEZZA IN CIMA) ---
|
||||
const SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(24.0, 0, 24.0, 24.0),
|
||||
child: DashboardTargetHeroCard(),
|
||||
),
|
||||
),
|
||||
|
||||
// --- QUICK ACTIONS: AZIONI RAPIDE ---
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||
child: _buildQuickActions(context),
|
||||
),
|
||||
),
|
||||
|
||||
const SliverToBoxAdapter(child: SizedBox(height: 32)),
|
||||
|
||||
// --- I WIDGET DELLA DASHBOARD (Responsive Grid) ---
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||
child: _buildQuickActions(context),
|
||||
sliver: SliverGrid(
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: 500,
|
||||
mainAxisSpacing: 16,
|
||||
crossAxisSpacing: 16,
|
||||
childAspectRatio: 1.3,
|
||||
),
|
||||
delegate: SliverChildListDelegate([
|
||||
DashboardStoreOperationListCard(),
|
||||
DashboardStoreTicketListCard(),
|
||||
DashboardExpiringContractsCard(),
|
||||
DashboardNoteListCard(),
|
||||
DashboardTaskListCard(),
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
const SliverToBoxAdapter(child: SizedBox(height: 32)),
|
||||
|
||||
// --- I WIDGET DELLA DASHBOARD (Responsive Grid) ---
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||
sliver: SliverGrid(
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: 500,
|
||||
mainAxisSpacing: 16,
|
||||
crossAxisSpacing: 16,
|
||||
childAspectRatio: 1.3,
|
||||
),
|
||||
delegate: SliverChildListDelegate([
|
||||
DashboardStoreOperationListCard(),
|
||||
DashboardStoreTicketListCard(),
|
||||
_buildDashboardWidget(
|
||||
title: context.l10n.homeExpiringContracts,
|
||||
icon: Icons.assignment_late_outlined,
|
||||
color: Colors.orange,
|
||||
context: context,
|
||||
),
|
||||
DashboardNoteListCard(),
|
||||
DashboardTaskListCard(),
|
||||
]),
|
||||
),
|
||||
),
|
||||
|
||||
// Spazio finale per non far attaccare l'ultima card al fondo
|
||||
const SliverToBoxAdapter(child: SizedBox(height: 40)),
|
||||
],
|
||||
// Spazio finale per non far attaccare l'ultima card al fondo
|
||||
const SliverToBoxAdapter(child: SizedBox(height: 40)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -308,82 +338,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDashboardWidget({
|
||||
required BuildContext context,
|
||||
required String title,
|
||||
required IconData icon,
|
||||
required Color color,
|
||||
VoidCallback? onTap,
|
||||
}) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
return Card(
|
||||
elevation: 0,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
side: BorderSide(color: theme.dividerColor.withValues(alpha: 0.5)),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(icon, color: color, size: 20),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
color: context.primaryText,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.more_vert,
|
||||
size: 20,
|
||||
color: context.secondaryText,
|
||||
),
|
||||
onPressed: () {},
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints(),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Center(
|
||||
child: Text(
|
||||
context.l10n.commonComingSoon,
|
||||
style: TextStyle(
|
||||
color: context.secondaryText.withValues(alpha: 0.7),
|
||||
fontStyle: FontStyle.italic,
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showStoreSelector(BuildContext context, ThemeData theme) {
|
||||
showModalBottomSheet(
|
||||
|
||||
@@ -126,11 +126,61 @@ class ProviderFormCubit extends Cubit<ProviderFormState> {
|
||||
}
|
||||
|
||||
Future<void> addLocationLocal(ProviderLocationModel location) async {
|
||||
List<ProviderLocationModel> currentLocations = List<ProviderLocationModel>.from(
|
||||
state.localLocations,
|
||||
);
|
||||
|
||||
final bool shouldBeMain = location.isMain || currentLocations.isEmpty;
|
||||
|
||||
if (shouldBeMain) {
|
||||
currentLocations = currentLocations
|
||||
.map((loc) => loc.copyWith(isMain: false))
|
||||
.toList();
|
||||
}
|
||||
|
||||
currentLocations.add(location.copyWith(isMain: shouldBeMain));
|
||||
emit(state.copyWith(localLocations: currentLocations));
|
||||
}
|
||||
|
||||
void updateLocationLocal(int index, ProviderLocationModel location) {
|
||||
final currentLocations = List<ProviderLocationModel>.from(
|
||||
state.localLocations,
|
||||
);
|
||||
currentLocations.add(location);
|
||||
emit(state.copyWith(localLocations: currentLocations));
|
||||
if (index < 0 || index >= currentLocations.length) return;
|
||||
|
||||
bool shouldBeMain = location.isMain;
|
||||
if (!shouldBeMain && currentLocations.length == 1) {
|
||||
shouldBeMain = true;
|
||||
}
|
||||
|
||||
final List<ProviderLocationModel> updatedList = [];
|
||||
for (int i = 0; i < currentLocations.length; i++) {
|
||||
if (i == index) {
|
||||
updatedList.add(location.copyWith(isMain: shouldBeMain));
|
||||
} else {
|
||||
updatedList.add(
|
||||
shouldBeMain
|
||||
? currentLocations[i].copyWith(isMain: false)
|
||||
: currentLocations[i],
|
||||
);
|
||||
}
|
||||
}
|
||||
emit(state.copyWith(localLocations: updatedList));
|
||||
}
|
||||
|
||||
void setMainLocationLocal(int index) {
|
||||
final currentLocations = List<ProviderLocationModel>.from(
|
||||
state.localLocations,
|
||||
);
|
||||
if (index < 0 || index >= currentLocations.length) return;
|
||||
|
||||
final updatedList = currentLocations.asMap().entries.map((entry) {
|
||||
final idx = entry.key;
|
||||
final loc = entry.value;
|
||||
return loc.copyWith(isMain: idx == index);
|
||||
}).toList();
|
||||
|
||||
emit(state.copyWith(localLocations: updatedList));
|
||||
}
|
||||
|
||||
void removeLocationLocal(int index) {
|
||||
@@ -138,7 +188,13 @@ class ProviderFormCubit extends Cubit<ProviderFormState> {
|
||||
state.localLocations,
|
||||
);
|
||||
if (index >= 0 && index < currentLocations.length) {
|
||||
currentLocations.removeAt(index);
|
||||
final removedLoc = currentLocations.removeAt(index);
|
||||
if (removedLoc.id != null && removedLoc.id!.isNotEmpty) {
|
||||
_repository.deleteLocation(removedLoc.id!);
|
||||
}
|
||||
if (removedLoc.isMain && currentLocations.isNotEmpty) {
|
||||
currentLocations[0] = currentLocations[0].copyWith(isMain: true);
|
||||
}
|
||||
emit(state.copyWith(localLocations: currentLocations));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,12 @@ class ProviderRepository {
|
||||
|
||||
// 4. Gestione Sedi (Locations)
|
||||
Future<void> saveLocation(ProviderLocationModel location) async {
|
||||
if (location.isMain && location.providerId.isNotEmpty) {
|
||||
await _supabase
|
||||
.from(Tables.providerLocations)
|
||||
.update({'is_main': false})
|
||||
.eq('provider_id', location.providerId);
|
||||
}
|
||||
await _supabase.from(Tables.providerLocations).upsert(location.toMap());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,42 @@
|
||||
import 'package:flux/features/master_data/providers/models/provider_model.dart';
|
||||
import 'package:flux/features/master_data/providers/models/provider_role.dart';
|
||||
import 'package:flux/features/operations/models/operation_type.dart';
|
||||
|
||||
extension ProviderCompatibility on ProviderModel {
|
||||
bool supportsOperation(String operationType) {
|
||||
if (operationType == 'Altro') return true;
|
||||
bool supportsOperationType(OperationType? operationType) {
|
||||
if (operationType == null || operationType == OperationType.altro) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (operationType) {
|
||||
case 'AL' || 'MNP':
|
||||
case OperationType.al ||
|
||||
OperationType.mnp ||
|
||||
OperationType.cb ||
|
||||
OperationType.upselling:
|
||||
return roles.contains(ProviderRole.mobile);
|
||||
case 'NIP' || 'FWA':
|
||||
case OperationType.nip || OperationType.fwa:
|
||||
return roles.contains(ProviderRole.landline);
|
||||
case 'UNICA':
|
||||
case OperationType.unica:
|
||||
return roles.contains(ProviderRole.landline) ||
|
||||
roles.contains(ProviderRole.mobile);
|
||||
case 'Energy':
|
||||
case OperationType.energy:
|
||||
return roles.contains(ProviderRole.energy);
|
||||
case 'Fin':
|
||||
case OperationType.fin:
|
||||
return roles.contains(ProviderRole.financing);
|
||||
case 'Entertainment':
|
||||
case OperationType.entertainment:
|
||||
return roles.contains(ProviderRole.entertainment);
|
||||
case 'TELEPASS':
|
||||
case OperationType.telepass:
|
||||
return roles.contains(ProviderRole.telepass);
|
||||
case OperationType.business:
|
||||
return roles.contains(ProviderRole.mobile) ||
|
||||
roles.contains(ProviderRole.landline);
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool supportsOperation(String operationType) {
|
||||
final type = OperationType.fromValue(operationType);
|
||||
return supportsOperationType(type);
|
||||
}
|
||||
}
|
||||
@@ -383,11 +383,47 @@ class _ProviderFormScreenState extends State<ProviderFormScreen> {
|
||||
itemBuilder: (context, index) {
|
||||
final loc = state.localLocations[index];
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
loc.isMain ? Icons.star : Icons.location_on,
|
||||
color: loc.isMain ? Colors.amber : null,
|
||||
onTap: () async {
|
||||
final providerFormCubit = context.read<ProviderFormCubit>();
|
||||
final res = await showDialog<ProviderLocationModel?>(
|
||||
context: context,
|
||||
builder: (context) => ProviderLocationDialog(initialLocation: loc),
|
||||
);
|
||||
if (res != null) {
|
||||
providerFormCubit.updateLocationLocal(index, res);
|
||||
}
|
||||
},
|
||||
leading: IconButton(
|
||||
tooltip: loc.isMain ? 'Sede predefinita' : 'Imposta come predefinita',
|
||||
icon: Icon(
|
||||
loc.isMain ? Icons.star : Icons.star_border,
|
||||
color: loc.isMain ? Colors.amber : Colors.grey,
|
||||
),
|
||||
onPressed: () => context
|
||||
.read<ProviderFormCubit>()
|
||||
.setMainLocationLocal(index),
|
||||
),
|
||||
title: Row(
|
||||
children: [
|
||||
Expanded(child: Text(loc.name)),
|
||||
if (loc.isMain)
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.amber.withValues(alpha: 0.2),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: const Text(
|
||||
'Predefinita',
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.amber,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
title: Text(loc.name),
|
||||
subtitle: Text(
|
||||
'${loc.address}, ${loc.city} (${loc.province})',
|
||||
),
|
||||
|
||||
@@ -37,10 +37,15 @@ class NotesCubit extends Cubit<NotesState> {
|
||||
try {
|
||||
_subscription = _repository
|
||||
.notesStream(companyId: companyId!, currentStaffId: staffId!)
|
||||
.listen((_) {
|
||||
// Quando il campanello suona (qualcosa è cambiato a DB), ricarichiamo!
|
||||
_loadNotesSilently();
|
||||
});
|
||||
.listen(
|
||||
(_) {
|
||||
// Quando il campanello suona (qualcosa è cambiato a DB), ricarichiamo!
|
||||
_loadNotesSilently();
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
debugPrint('Notes stream error: $error');
|
||||
},
|
||||
);
|
||||
} on Exception catch (e) {
|
||||
debugPrint(e.toString());
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flux/features/master_data/products/models/model_model.dart';
|
||||
import 'package:flux/features/master_data/providers/models/provider_model.dart';
|
||||
import 'package:flux/features/master_data/providers/models/provider_model_extensions.dart';
|
||||
import 'package:flux/features/operations/models/operation_detail_model.dart';
|
||||
import 'package:flux/features/operations/models/operation_type.dart';
|
||||
|
||||
part 'operation_details_form_state.dart';
|
||||
|
||||
@@ -22,7 +23,7 @@ class OperationDetailsFormCubit extends Cubit<OperationDetailsFormState> {
|
||||
if (initialDetail == null &&
|
||||
allProviders != null &&
|
||||
allProviders.isNotEmpty) {
|
||||
const defaultType = 'AL';
|
||||
const defaultType = OperationType.al;
|
||||
setTypeWithSmartDefaults(
|
||||
newType: defaultType,
|
||||
allProviders: allProviders,
|
||||
@@ -32,7 +33,7 @@ class OperationDetailsFormCubit extends Cubit<OperationDetailsFormState> {
|
||||
}
|
||||
|
||||
void updateFields({
|
||||
String? type,
|
||||
OperationType? type,
|
||||
String? subType,
|
||||
ProviderModel? provider,
|
||||
ModelModel? model,
|
||||
@@ -79,7 +80,7 @@ class OperationDetailsFormCubit extends Cubit<OperationDetailsFormState> {
|
||||
}
|
||||
|
||||
void setTypeWithSmartDefaults({
|
||||
required String newType,
|
||||
required OperationType newType,
|
||||
required List<ProviderModel> allProviders,
|
||||
String? defaultProviderId,
|
||||
}) {
|
||||
@@ -88,7 +89,7 @@ class OperationDetailsFormCubit extends Cubit<OperationDetailsFormState> {
|
||||
final foundDefault = allProviders.firstWhere(
|
||||
(p) =>
|
||||
p.id == defaultProviderId &&
|
||||
p.supportsOperation(newType) &&
|
||||
p.supportsOperationType(newType) &&
|
||||
p.isActive,
|
||||
orElse: () => const ProviderModel(companyId: '', name: ''),
|
||||
);
|
||||
@@ -98,7 +99,7 @@ class OperationDetailsFormCubit extends Cubit<OperationDetailsFormState> {
|
||||
}
|
||||
if (selectedProvider == null) {
|
||||
final foundCompatible = allProviders.firstWhere(
|
||||
(p) => p.supportsOperation(newType) && p.isActive,
|
||||
(p) => p.supportsOperationType(newType) && p.isActive,
|
||||
orElse: () => const ProviderModel(companyId: '', name: ''),
|
||||
);
|
||||
if (foundCompatible.id != null) {
|
||||
@@ -109,7 +110,7 @@ class OperationDetailsFormCubit extends Cubit<OperationDetailsFormState> {
|
||||
final current = state.operationDetail;
|
||||
final updated = current.copyWith(
|
||||
type: newType,
|
||||
subType: newType == 'Energy' ? 'Luce' : null,
|
||||
subType: newType == OperationType.energy ? EnergySubtypes.luce : null,
|
||||
provider: selectedProvider != null ? () => selectedProvider : null,
|
||||
providerId: selectedProvider?.id,
|
||||
);
|
||||
|
||||
@@ -104,6 +104,7 @@ class OperationFormCubit extends Cubit<OperationFormState> {
|
||||
try {
|
||||
OperationModel operationToSave = state.operation.copyWith(
|
||||
status: targetStatus,
|
||||
showInDashboard: true,
|
||||
);
|
||||
if (operationToSave.reference.isEmpty) {
|
||||
if (operationToSave.customer != null &&
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
@@ -12,10 +14,19 @@ class OperationListCubit extends Cubit<OperationListState> {
|
||||
final OperationsRepository _repository = GetIt.I<OperationsRepository>();
|
||||
final SessionCubit _sessionCubit = GetIt.I<SessionCubit>();
|
||||
|
||||
OperationListCubit() : super(const OperationListState());
|
||||
|
||||
StreamSubscription<void>? _operationsSubscription;
|
||||
int _fetchId = 0;
|
||||
|
||||
OperationListCubit() : super(const OperationListState()) {
|
||||
_operationsSubscription = _repository.onOperationsChanged.listen((_) {
|
||||
refreshCurrentPage();
|
||||
});
|
||||
}
|
||||
|
||||
void refreshCurrentPage() {
|
||||
loadSpecificPageDesktop(state.currentPage);
|
||||
}
|
||||
|
||||
// 🥷 MOTORE 1: DESKTOP (Sostituisce la lista)
|
||||
Future<void> loadSpecificPageDesktop(int page) async {
|
||||
final currentFetchId = ++_fetchId;
|
||||
@@ -124,4 +135,10 @@ class OperationListCubit extends Cubit<OperationListState> {
|
||||
|
||||
loadSpecificPageDesktop(1);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
_operationsSubscription?.cancel();
|
||||
return super.close();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flux/core/enums_and_consts/consts.dart';
|
||||
import 'package:flux/features/master_data/store/models/store_model.dart';
|
||||
@@ -10,6 +11,17 @@ import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
class OperationsRepository {
|
||||
final SupabaseClient _supabase = sl<SupabaseClient>();
|
||||
|
||||
final StreamController<void> _operationsChangedController =
|
||||
StreamController<void>.broadcast();
|
||||
|
||||
Stream<void> get onOperationsChanged => _operationsChangedController.stream;
|
||||
|
||||
void notifyOperationsChanged() {
|
||||
if (!_operationsChangedController.isClosed) {
|
||||
_operationsChangedController.add(null);
|
||||
}
|
||||
}
|
||||
|
||||
Future<OperationModel?> getOperationById(String id) async {
|
||||
try {
|
||||
final response = await _supabase
|
||||
@@ -45,6 +57,7 @@ class OperationsRepository {
|
||||
int itemsPerPage = 20,
|
||||
String? searchTerm,
|
||||
DateTimeRange? dateRange,
|
||||
bool onlyShowInDashboard = false,
|
||||
}) async {
|
||||
try {
|
||||
// Calcoliamo il range di partenza e fine per Supabase
|
||||
@@ -69,6 +82,10 @@ class OperationsRepository {
|
||||
''')
|
||||
.eq('company_id', companyId);
|
||||
|
||||
if (onlyShowInDashboard) {
|
||||
query = query.eq('show_in_dashboard', true);
|
||||
}
|
||||
|
||||
// Filtro Range Date
|
||||
if (dateRange != null) {
|
||||
query = query
|
||||
@@ -161,6 +178,7 @@ class OperationsRepository {
|
||||
staffId: createdById,
|
||||
companyId: currentStore.companyId,
|
||||
status: OperationStatus.success,
|
||||
showInDashboard: false,
|
||||
)
|
||||
.toMap(),
|
||||
)
|
||||
@@ -169,6 +187,7 @@ class OperationsRepository {
|
||||
${Tables.staffMembers}(*)
|
||||
''')
|
||||
.single();
|
||||
notifyOperationsChanged();
|
||||
return OperationModel.fromMap(res);
|
||||
} on Exception catch (e) {
|
||||
debugPrint('ERRORE CREAZIONE OPERAZIONE: $e');
|
||||
@@ -179,6 +198,7 @@ class OperationsRepository {
|
||||
Future<void> deleteOperation(String id) async {
|
||||
try {
|
||||
await _supabase.from(Tables.operations).delete().eq('id', id);
|
||||
notifyOperationsChanged();
|
||||
} catch (e) {
|
||||
debugPrint('ERRORE CANCELLAZIONE OPERAZIONE: $e');
|
||||
throw Exception('Errore nella cancellazione dell\'operazione: $e');
|
||||
@@ -225,9 +245,73 @@ class OperationsRepository {
|
||||
.from(Tables.operationDetails)
|
||||
.upsert(detailToSave.toMap());
|
||||
}
|
||||
notifyOperationsChanged();
|
||||
} catch (e) {
|
||||
debugPrint('ERRORE SALVATAGGIO OPERAZIONE: $e');
|
||||
throw Exception('Errore nel salvataggio dell\'operazione: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<OperationModel>> fetchExpiringOperations({
|
||||
required String companyId,
|
||||
String? storeId,
|
||||
int limit = 20,
|
||||
}) async {
|
||||
try {
|
||||
var query = _supabase
|
||||
.from(Tables.operations)
|
||||
.select('''
|
||||
*,
|
||||
${Tables.customers}(*),
|
||||
${Tables.stores}(*),
|
||||
${Tables.staffMembers}(*),
|
||||
${Tables.attachments}(*),
|
||||
${Tables.operationDetails}!inner(
|
||||
*,
|
||||
${Tables.providers}(*),
|
||||
${Tables.models}(*)
|
||||
)
|
||||
''')
|
||||
.eq('company_id', companyId)
|
||||
.not('${Tables.operationDetails}.expiration_date', 'is', null);
|
||||
|
||||
if (storeId != null && storeId.isNotEmpty) {
|
||||
query = query.or('store_id.eq.$storeId,store_id.is.null');
|
||||
}
|
||||
|
||||
final response = await query
|
||||
.order('created_at', ascending: false)
|
||||
.limit(limit);
|
||||
|
||||
final List<OperationModel> operations = (response as List)
|
||||
.map((map) => OperationModel.fromMap(map as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
operations.sort((a, b) {
|
||||
final aExp = getEarliestExpiration(a);
|
||||
final bExp = getEarliestExpiration(b);
|
||||
if (aExp == null && bExp == null) return 0;
|
||||
if (aExp == null) return 1;
|
||||
if (bExp == null) return -1;
|
||||
return aExp.compareTo(bExp);
|
||||
});
|
||||
|
||||
return operations;
|
||||
} catch (e) {
|
||||
debugPrint('Errore nel recupero contratti/operazioni in scadenza: $e');
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
static DateTime? getEarliestExpiration(OperationModel op) {
|
||||
DateTime? earliest;
|
||||
for (final d in op.details) {
|
||||
if (d.expirationDate != null) {
|
||||
if (earliest == null || d.expirationDate!.isBefore(earliest)) {
|
||||
earliest = d.expirationDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
return earliest;
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,13 @@ import 'package:equatable/equatable.dart';
|
||||
import 'package:flux/core/enums_and_consts/consts.dart';
|
||||
import 'package:flux/features/master_data/products/models/model_model.dart';
|
||||
import 'package:flux/features/master_data/providers/models/provider_model.dart';
|
||||
import 'package:flux/features/operations/models/operation_type.dart';
|
||||
|
||||
class OperationDetailModel extends Equatable {
|
||||
final String? id;
|
||||
final DateTime? createdAt;
|
||||
final String operationId;
|
||||
final String? type;
|
||||
final OperationType? type;
|
||||
final String? providerId;
|
||||
final String? modelId;
|
||||
final String? description;
|
||||
@@ -57,7 +58,7 @@ class OperationDetailModel extends Equatable {
|
||||
String? id,
|
||||
DateTime? createdAt,
|
||||
String? operationId,
|
||||
String? type,
|
||||
OperationType? type,
|
||||
String? providerId,
|
||||
String? modelId,
|
||||
String? description,
|
||||
@@ -84,7 +85,7 @@ class OperationDetailModel extends Equatable {
|
||||
);
|
||||
|
||||
factory OperationDetailModel.empty() {
|
||||
return OperationDetailModel();
|
||||
return const OperationDetailModel();
|
||||
}
|
||||
|
||||
factory OperationDetailModel.fromMap(Map<String, dynamic> map) {
|
||||
@@ -94,7 +95,7 @@ class OperationDetailModel extends Equatable {
|
||||
? DateTime.parse(map['created_at'])
|
||||
: null,
|
||||
operationId: map['operation_id'] as String? ?? '',
|
||||
type: map['type'] as String?,
|
||||
type: OperationType.fromValue(map['type'] as String?),
|
||||
providerId: map['provider_id'] as String?,
|
||||
modelId: map['model_id'] as String?,
|
||||
description: map['description'] as String?,
|
||||
@@ -129,7 +130,7 @@ class OperationDetailModel extends Equatable {
|
||||
return {
|
||||
if (id?.isNotEmpty == true) 'id': id,
|
||||
if (operationId.isNotEmpty) 'operation_id': operationId,
|
||||
if (type?.isNotEmpty == true) 'type': type,
|
||||
if (type != null) 'type': type!.value,
|
||||
if (pId?.isNotEmpty == true) 'provider_id': pId,
|
||||
if (mId?.isNotEmpty == true) 'model_id': mId,
|
||||
if (description?.isNotEmpty == true) 'description': description,
|
||||
|
||||
@@ -126,6 +126,7 @@ class OperationModel extends Equatable {
|
||||
return OperationModel(
|
||||
id: null,
|
||||
createdAt: null,
|
||||
showInDashboard: false,
|
||||
companyId: '',
|
||||
details: const [],
|
||||
);
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Enum fortemente tipizzato per i tipi di operazione/servizio nel sistema Flux
|
||||
enum OperationType {
|
||||
al(
|
||||
value: 'AL',
|
||||
label: 'Attivazione Linea',
|
||||
shortLabel: 'AL',
|
||||
icon: Icons.sim_card_outlined,
|
||||
color: Colors.blue,
|
||||
),
|
||||
mnp(
|
||||
value: 'MNP',
|
||||
label: 'Portabilità',
|
||||
shortLabel: 'MNP',
|
||||
icon: Icons.phone_forwarded_outlined,
|
||||
color: Colors.indigo,
|
||||
),
|
||||
nip(
|
||||
value: 'NIP',
|
||||
label: 'Nuovo Impianto',
|
||||
shortLabel: 'NIP',
|
||||
icon: Icons.home_repair_service_outlined,
|
||||
color: Colors.cyan,
|
||||
),
|
||||
unica(
|
||||
value: 'UNICA',
|
||||
label: 'TIM Unica / Convergenza',
|
||||
shortLabel: 'UNICA',
|
||||
icon: Icons.merge_type_outlined,
|
||||
color: Colors.orange,
|
||||
),
|
||||
fwa(
|
||||
value: 'FWA',
|
||||
label: 'Fixed Wireless Access',
|
||||
shortLabel: 'FWA',
|
||||
icon: Icons.router_outlined,
|
||||
color: Colors.teal,
|
||||
),
|
||||
telepass(
|
||||
value: 'TELEPASS',
|
||||
label: 'Telepass',
|
||||
shortLabel: 'Telepass',
|
||||
icon: Icons.directions_car_outlined,
|
||||
color: Colors.amber,
|
||||
),
|
||||
energy(
|
||||
value: 'Energy',
|
||||
label: 'Energia Luce & Gas',
|
||||
shortLabel: 'Energy',
|
||||
icon: Icons.bolt_outlined,
|
||||
color: Colors.green,
|
||||
),
|
||||
fin(
|
||||
value: 'Fin',
|
||||
label: 'Finanziamento',
|
||||
shortLabel: 'Fin',
|
||||
icon: Icons.credit_card_outlined,
|
||||
color: Colors.purple,
|
||||
),
|
||||
entertainment(
|
||||
value: 'Entertainment',
|
||||
label: 'Contenuti & Intrattenimento',
|
||||
shortLabel: 'Entertainment',
|
||||
icon: Icons.live_tv_outlined,
|
||||
color: Colors.redAccent,
|
||||
),
|
||||
cb(
|
||||
value: 'CB',
|
||||
label: 'Customer Base',
|
||||
shortLabel: 'CB',
|
||||
icon: Icons.people_alt_outlined,
|
||||
color: Colors.deepOrange,
|
||||
),
|
||||
upselling(
|
||||
value: 'Upselling',
|
||||
label: 'Upselling / Cambio Offerta',
|
||||
shortLabel: 'Upselling',
|
||||
icon: Icons.trending_up_outlined,
|
||||
color: Colors.deepPurple,
|
||||
),
|
||||
business(
|
||||
value: 'Business',
|
||||
label: 'Servizio Business',
|
||||
shortLabel: 'Business',
|
||||
icon: Icons.business_center_outlined,
|
||||
color: Colors.blueGrey,
|
||||
),
|
||||
ricontatto(
|
||||
value: 'Ricontatto',
|
||||
label: 'Ricontatto / Scadenza',
|
||||
shortLabel: 'Ricontatto',
|
||||
icon: Icons.event_repeat_outlined,
|
||||
color: Colors.amber,
|
||||
),
|
||||
altro(
|
||||
value: 'Altro',
|
||||
label: 'Altro Servizio',
|
||||
shortLabel: 'Altro',
|
||||
icon: Icons.more_horiz_outlined,
|
||||
color: Colors.grey,
|
||||
);
|
||||
|
||||
final String value;
|
||||
final String label;
|
||||
final String shortLabel;
|
||||
final IconData icon;
|
||||
final Color color;
|
||||
|
||||
const OperationType({
|
||||
required this.value,
|
||||
required this.label,
|
||||
required this.shortLabel,
|
||||
required this.icon,
|
||||
required this.color,
|
||||
});
|
||||
|
||||
/// Ricostruisce l'enum dal valore stringa salvato su DB in modo case-insensitive
|
||||
static OperationType? fromValue(String? val) {
|
||||
if (val == null || val.trim().isEmpty) return null;
|
||||
final clean = val.trim().toLowerCase();
|
||||
for (final t in OperationType.values) {
|
||||
if (t.value.toLowerCase() == clean || t.name.toLowerCase() == clean) {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
return OperationType.altro;
|
||||
}
|
||||
}
|
||||
|
||||
/// Sottotipi standard suggeriti per Entertainment
|
||||
class EntertainmentSubtypes {
|
||||
static const String calcio = 'Calcio';
|
||||
static const String cinemaTv = 'Cinema & TV';
|
||||
static const String musica = 'Musica';
|
||||
static const String altro = 'Altro';
|
||||
|
||||
static const List<String> all = [calcio, cinemaTv, musica, altro];
|
||||
}
|
||||
|
||||
/// Sottotipi standard per Energy
|
||||
class EnergySubtypes {
|
||||
static const String luce = 'Luce';
|
||||
static const String gas = 'Gas';
|
||||
static const String dual = 'Luce e Gas';
|
||||
|
||||
static const List<String> all = [luce, gas, dual];
|
||||
}
|
||||
|
||||
/// Sottotipi standard per Ricontatti / Bollette in scadenza
|
||||
class RicontattoSubtypes {
|
||||
static const String luce = 'Luce';
|
||||
static const String gas = 'Gas';
|
||||
static const String dual = 'Luce e Gas';
|
||||
static const String telefonia = 'Telefonia';
|
||||
static const String altro = 'Altro';
|
||||
|
||||
static const List<String> all = [luce, gas, dual, telefonia, altro];
|
||||
}
|
||||
@@ -83,9 +83,17 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
|
||||
void _saveOperation({
|
||||
required OperationStatus targetStatus,
|
||||
required bool isClosingIntent,
|
||||
}) {
|
||||
}) async {
|
||||
if (!_formKey.currentState!.validate()) return;
|
||||
|
||||
if (isClosingIntent) {
|
||||
final details = context.read<OperationFormCubit>().state.operation.details;
|
||||
if (details.isEmpty) {
|
||||
final shouldProceed = await _showEmptyDetailsWarningDialog(context);
|
||||
if (shouldProceed != true || !mounted) return;
|
||||
}
|
||||
}
|
||||
|
||||
_isClosingIntent = isClosingIntent;
|
||||
|
||||
_flushControllersToCubit();
|
||||
@@ -95,6 +103,36 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool?> _showEmptyDetailsWarningDialog(BuildContext context) {
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
builder: (dialogContext) {
|
||||
return AlertDialog(
|
||||
title: const Row(
|
||||
children: [
|
||||
Icon(Icons.warning_amber_rounded, color: Colors.orange),
|
||||
SizedBox(width: 8),
|
||||
Text('Dettagli operazione vuoti'),
|
||||
],
|
||||
),
|
||||
content: const Text(
|
||||
'Non hai inserito alcun dettaglio per questa operazione.\n\nVuoi procedere comunque a salvare e uscire, oppure annullare per aggiungerli?',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(dialogContext).pop(false),
|
||||
child: const Text('Annulla'),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () => Navigator.of(dialogContext).pop(true),
|
||||
child: const Text('Salva e chiudi comunque'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<_UnsavedChangesAction?> _showUnsavedChangesDialog(
|
||||
BuildContext context,
|
||||
) {
|
||||
@@ -171,6 +209,15 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
|
||||
!_isInitialized) {
|
||||
_syncTextControllers(formState.operation);
|
||||
}
|
||||
if (formState.operation.id != null &&
|
||||
formState.operation.id!.isNotEmpty) {
|
||||
final attachmentsBloc = formContext.read<AttachmentsBloc>();
|
||||
if (attachmentsBloc.state.parentId != formState.operation.id) {
|
||||
attachmentsBloc.add(
|
||||
ParentEntitySavedEvent(formState.operation.id!),
|
||||
);
|
||||
}
|
||||
}
|
||||
if ((formState.status == OperationFormStatus.success &&
|
||||
_isClosingIntent) ||
|
||||
formState.status == OperationFormStatus.discarded) {
|
||||
@@ -612,6 +659,15 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
|
||||
parentType: AttachmentParentType.operation,
|
||||
parentId: state.operation.id,
|
||||
titleForUpload: state.operation.customer?.name ?? 'Nuova Pratica',
|
||||
onEnsureEntitySaved: () async {
|
||||
if (!_formKey.currentState!.validate()) return null;
|
||||
_flushControllersToCubit();
|
||||
final cubit = context.read<OperationFormCubit>();
|
||||
await cubit.saveOperation(
|
||||
targetStatus: state.operation.status,
|
||||
);
|
||||
return cubit.state.operation.id;
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:flux/features/master_data/staff/models/staff_member_model.dart';
|
||||
import 'package:flux/features/operations/blocs/operation_list_cubit.dart';
|
||||
import 'package:flux/features/operations/models/operation_detail_model.dart';
|
||||
import 'package:flux/features/operations/models/operation_model.dart';
|
||||
import 'package:flux/features/operations/models/operation_type.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class OperationListScreen extends StatefulWidget {
|
||||
@@ -406,33 +407,19 @@ class _RichOperationCard extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
Color _getTypeColor(String? type) {
|
||||
switch (type?.toUpperCase()) {
|
||||
case 'FIN':
|
||||
return Colors.deepPurple;
|
||||
case 'TELEPASS':
|
||||
return Colors.yellow.shade700;
|
||||
case 'ENERGY':
|
||||
return Colors.amber.shade700;
|
||||
case 'ENTERTAINMENT':
|
||||
return Colors.pinkAccent;
|
||||
case 'AL':
|
||||
case 'MNP':
|
||||
return Colors.indigo;
|
||||
case 'NIP':
|
||||
case 'FWA':
|
||||
return Colors.cyan;
|
||||
default:
|
||||
return Colors.blueGrey;
|
||||
}
|
||||
Color _getTypeColor(OperationType? type) {
|
||||
return type?.color ?? Colors.blueGrey;
|
||||
}
|
||||
|
||||
IconData? _getIconForType(String? type, String? subtype) {
|
||||
if (type?.toLowerCase() == 'energy') {
|
||||
IconData? _getIconForType(OperationType? type, String? subtype) {
|
||||
if (type == OperationType.energy) {
|
||||
if (subtype?.toLowerCase() == 'luce') return Icons.bolt;
|
||||
if (subtype?.toLowerCase() == 'gas') return Icons.local_fire_department;
|
||||
}
|
||||
return null;
|
||||
if (type == OperationType.entertainment) {
|
||||
if (subtype?.toLowerCase() == 'calcio') return Icons.sports_soccer;
|
||||
}
|
||||
return type?.icon;
|
||||
}
|
||||
|
||||
Widget _buildDetailItem(BuildContext context, OperationDetailModel detail) {
|
||||
@@ -441,8 +428,8 @@ class _RichOperationCard extends StatelessWidget {
|
||||
final icon = _getIconForType(detail.type, detail.subType);
|
||||
|
||||
final typeLabel = (detail.subType != null && detail.subType!.isNotEmpty)
|
||||
? '${detail.type ?? ''} (${detail.subType})'
|
||||
: (detail.type ?? 'Dettaglio');
|
||||
? '${detail.type?.shortLabel ?? ''} (${detail.subType})'
|
||||
: (detail.type?.shortLabel ?? 'Dettaglio');
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
|
||||
@@ -7,23 +7,12 @@ import 'package:flux/features/master_data/providers/models/provider_model_extens
|
||||
import 'package:flux/features/operations/blocs/operation_details_form_cubit.dart';
|
||||
import 'package:flux/features/operations/blocs/operation_details_list_cubit.dart';
|
||||
import 'package:flux/features/operations/models/operation_detail_model.dart';
|
||||
import 'package:flux/features/operations/models/operation_type.dart';
|
||||
import 'package:flux/features/master_data/products/models/model_model.dart';
|
||||
|
||||
class OperationDetailsSection extends StatelessWidget {
|
||||
const OperationDetailsSection({super.key});
|
||||
|
||||
static const List<String> _availableTypes = [
|
||||
'AL',
|
||||
'MNP',
|
||||
'NIP',
|
||||
'UNICA',
|
||||
'FWA',
|
||||
'TELEPASS',
|
||||
'Energy',
|
||||
'Fin',
|
||||
'Entertainment',
|
||||
'Altro',
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
@@ -117,10 +106,11 @@ class OperationDetailsSection extends StatelessWidget {
|
||||
final typeColor = _getTypeColor(detail.type);
|
||||
final providerColor = detail.provider?.displayColor ?? Colors.blueGrey;
|
||||
|
||||
final typeLabel = detail.type?.shortLabel ?? 'Dettaglio';
|
||||
final typeText =
|
||||
(detail.subType != null && detail.subType!.isNotEmpty)
|
||||
? '${detail.type ?? ''} (${detail.subType})'
|
||||
: (detail.type ?? 'Dettaglio');
|
||||
? '$typeLabel (${detail.subType})'
|
||||
: typeLabel;
|
||||
|
||||
return Card(
|
||||
elevation: 0,
|
||||
@@ -292,48 +282,19 @@ class OperationDetailsSection extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Color _getTypeColor(String? type) {
|
||||
switch (type?.toUpperCase()) {
|
||||
case 'FIN':
|
||||
return Colors.deepPurple;
|
||||
case 'TELEPASS':
|
||||
return Colors.yellow.shade800;
|
||||
case 'ENERGY':
|
||||
return Colors.amber.shade800;
|
||||
case 'ENTERTAINMENT':
|
||||
return Colors.pinkAccent;
|
||||
case 'AL':
|
||||
case 'MNP':
|
||||
return Colors.indigo;
|
||||
case 'NIP':
|
||||
case 'FWA':
|
||||
return Colors.cyan;
|
||||
default:
|
||||
return Colors.blueGrey;
|
||||
}
|
||||
Color _getTypeColor(OperationType? type) {
|
||||
return type?.color ?? Colors.blueGrey;
|
||||
}
|
||||
|
||||
IconData _getIconForType(String? type, String? subtype) {
|
||||
if (type?.toLowerCase() == 'energy') {
|
||||
IconData _getIconForType(OperationType? type, String? subtype) {
|
||||
if (type == OperationType.energy) {
|
||||
if (subtype?.toLowerCase() == 'luce') return Icons.bolt;
|
||||
if (subtype?.toLowerCase() == 'gas') return Icons.local_fire_department;
|
||||
}
|
||||
switch (type?.toUpperCase()) {
|
||||
case 'FIN':
|
||||
return Icons.devices;
|
||||
case 'TELEPASS':
|
||||
return Icons.directions_car;
|
||||
case 'ENTERTAINMENT':
|
||||
return Icons.tv;
|
||||
case 'AL':
|
||||
case 'MNP':
|
||||
return Icons.phone_android;
|
||||
case 'NIP':
|
||||
case 'FWA':
|
||||
return Icons.wifi;
|
||||
default:
|
||||
return Icons.build;
|
||||
if (type == OperationType.entertainment) {
|
||||
if (subtype?.toLowerCase() == 'calcio') return Icons.sports_soccer;
|
||||
}
|
||||
return type?.icon ?? Icons.build;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,7 +333,7 @@ class _OperationDetailFormSheetState
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _showProviderModal(BuildContext context, String operationType) {
|
||||
void _showProviderModal(BuildContext context, OperationType? operationType) {
|
||||
final formCubit = context.read<OperationDetailsFormCubit>();
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
@@ -415,7 +376,7 @@ class _OperationDetailFormSheetState
|
||||
|
||||
final filteredProviders =
|
||||
state.providers.where((p) {
|
||||
return p.supportsOperation(operationType) &&
|
||||
return p.supportsOperationType(operationType) &&
|
||||
p.isActive;
|
||||
}).toList();
|
||||
|
||||
@@ -528,7 +489,7 @@ class _OperationDetailFormSheetState
|
||||
>(
|
||||
builder: (context, formState) {
|
||||
final detail = formState.operationDetail;
|
||||
final currentType = detail.type ?? 'AL';
|
||||
final currentType = detail.type ?? OperationType.al;
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
@@ -573,11 +534,10 @@ class _OperationDetailFormSheetState
|
||||
spacing: 8.0,
|
||||
runSpacing: 8.0,
|
||||
children:
|
||||
OperationDetailsSection._availableTypes.map((
|
||||
type,
|
||||
) {
|
||||
OperationType.values.map((type) {
|
||||
return ChoiceChip(
|
||||
label: Text(type),
|
||||
avatar: Icon(type.icon, size: 16),
|
||||
label: Text(type.shortLabel),
|
||||
selected: currentType == type,
|
||||
onSelected: (selected) {
|
||||
if (selected) {
|
||||
@@ -638,18 +598,18 @@ class _OperationDetailFormSheetState
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 3. Scenario Energy (Dropdown Fisso)
|
||||
if (currentType == 'Energy') ...[
|
||||
if (currentType == OperationType.energy) ...[
|
||||
DropdownButtonFormField<String>(
|
||||
initialValue:
|
||||
(detail.subType != null &&
|
||||
detail.subType!.isNotEmpty)
|
||||
? detail.subType
|
||||
: 'Luce',
|
||||
: EnergySubtypes.luce,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Dettaglio Fornitura',
|
||||
),
|
||||
items:
|
||||
['Luce', 'Gas']
|
||||
EnergySubtypes.all
|
||||
.map(
|
||||
(s) => DropdownMenuItem(
|
||||
value: s,
|
||||
@@ -681,7 +641,7 @@ class _OperationDetailFormSheetState
|
||||
],
|
||||
|
||||
// 4. Scenario Fin (Ricerca Modello/Prodotto)
|
||||
if (currentType == 'Fin') ...[
|
||||
if (currentType == OperationType.fin) ...[
|
||||
SharedModelSection(
|
||||
label: 'Seleziona Dispositivo/Prodotto',
|
||||
modelId: detail.modelId,
|
||||
@@ -689,22 +649,116 @@ class _OperationDetailFormSheetState
|
||||
onModelSelected: (id, name) {
|
||||
context
|
||||
.read<OperationDetailsFormCubit>()
|
||||
.updateFields(modelId: id);
|
||||
.updateFields(
|
||||
modelId: id,
|
||||
model: ModelModel(
|
||||
id: id,
|
||||
name: name,
|
||||
nameWithBrand: name,
|
||||
brandId: '',
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
|
||||
// 5. Scenario Entertainment o Custom (Testo libero)
|
||||
if (currentType == 'Entertainment' ||
|
||||
currentType == 'Altro') ...[
|
||||
// 5. Scenario Entertainment (Chip veloci per Calcio/DAZN, Cinema, Musica + Campo testo)
|
||||
if (currentType == OperationType.entertainment) ...[
|
||||
const Text(
|
||||
'Categoria Contenuto / Piattaforma',
|
||||
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 13),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Wrap(
|
||||
spacing: 8.0,
|
||||
runSpacing: 8.0,
|
||||
children: EntertainmentSubtypes.all.map((sub) {
|
||||
final isSelected = detail.subType?.toLowerCase() == sub.toLowerCase();
|
||||
return ChoiceChip(
|
||||
avatar: sub == EntertainmentSubtypes.calcio
|
||||
? const Icon(Icons.sports_soccer, size: 16)
|
||||
: (sub == EntertainmentSubtypes.cinemaTv
|
||||
? const Icon(Icons.movie_outlined, size: 16)
|
||||
: (sub == EntertainmentSubtypes.musica
|
||||
? const Icon(Icons.music_note_outlined, size: 16)
|
||||
: null)),
|
||||
label: Text(sub),
|
||||
selected: isSelected,
|
||||
onSelected: (selected) {
|
||||
final newVal = selected ? sub : null;
|
||||
_subtypeController.text = newVal ?? '';
|
||||
context.read<OperationDetailsFormCubit>().updateFields(subType: newVal);
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextFormField(
|
||||
controller: _subtypeController,
|
||||
decoration: InputDecoration(
|
||||
labelText:
|
||||
currentType == 'Entertainment'
|
||||
? 'Piattaforma (es. Netflix, DAZN, Spotify...)'
|
||||
: 'Specifica il servizio (es. Monopattino)',
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Specifica Piattaforma / Offerta (opzionale)',
|
||||
hintText: 'Es. DAZN, TIMVISION Calcio, Netflix, Spotify...',
|
||||
),
|
||||
onChanged: (val) {
|
||||
context.read<OperationDetailsFormCubit>().updateFields(subType: val);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
|
||||
// Scenario Ricontatto / Bolletta in scadenza
|
||||
if (currentType == OperationType.ricontatto) ...[
|
||||
const Text(
|
||||
'Tipo di Fornitura / Servizio da Ricontattare',
|
||||
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 13),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Wrap(
|
||||
spacing: 8.0,
|
||||
runSpacing: 8.0,
|
||||
children: RicontattoSubtypes.all.map((sub) {
|
||||
final isSelected = detail.subType?.toLowerCase() == sub.toLowerCase();
|
||||
return ChoiceChip(
|
||||
avatar: sub == RicontattoSubtypes.luce
|
||||
? const Icon(Icons.bolt_outlined, size: 16)
|
||||
: (sub == RicontattoSubtypes.gas
|
||||
? const Icon(Icons.local_fire_department_outlined, size: 16)
|
||||
: (sub == RicontattoSubtypes.telefonia
|
||||
? const Icon(Icons.phone_outlined, size: 16)
|
||||
: null)),
|
||||
label: Text(sub),
|
||||
selected: isSelected,
|
||||
onSelected: (selected) {
|
||||
final newVal = selected ? sub : null;
|
||||
_subtypeController.text = newVal ?? '';
|
||||
context.read<OperationDetailsFormCubit>().updateFields(subType: newVal);
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextFormField(
|
||||
controller: _descriptionController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Gestore Attuale / Note Offerta',
|
||||
hintText: 'Es. Enel Luce 0.15€/kWh, scadenza vincolo tra 10 mesi...',
|
||||
),
|
||||
onChanged: (val) {
|
||||
context
|
||||
.read<OperationDetailsFormCubit>()
|
||||
.updateFields(description: val);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
|
||||
// Scenario Altro (Testo libero)
|
||||
if (currentType == OperationType.altro) ...[
|
||||
TextFormField(
|
||||
controller: _subtypeController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Specifica il servizio (es. Monopattino)',
|
||||
),
|
||||
onChanged: (val) {
|
||||
context
|
||||
@@ -717,10 +771,11 @@ class _OperationDetailFormSheetState
|
||||
|
||||
// 6. Scadenza (Reattiva per tipi complessi)
|
||||
if ([
|
||||
'Energy',
|
||||
'Fin',
|
||||
'Entertainment',
|
||||
'Altro',
|
||||
OperationType.energy,
|
||||
OperationType.fin,
|
||||
OperationType.entertainment,
|
||||
OperationType.ricontatto,
|
||||
OperationType.altro,
|
||||
].contains(currentType)) ...[
|
||||
_buildDurationQuickPicks(context),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
@@ -4,6 +4,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/core/routes/routes.dart';
|
||||
import 'package:flux/core/theme/theme.dart';
|
||||
import 'package:flux/core/utils/update_prompt_helper.dart';
|
||||
import 'package:flux/core/utils/version_check_service.dart';
|
||||
import 'package:flux/features/settings/blocs/settings_cubit.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
@@ -91,6 +93,22 @@ class SettingsScreen extends StatelessWidget {
|
||||
context: context,
|
||||
onTap: () => context.pushNamed(Routes.themeSettings),
|
||||
),
|
||||
const Divider(height: 30),
|
||||
FutureBuilder<String>(
|
||||
future: VersionCheckService.getFullVersionString(),
|
||||
builder: (context, snapshot) {
|
||||
final versionText = snapshot.data ?? '...';
|
||||
return _settingsTile(
|
||||
icon: Icons.info_outline,
|
||||
title: 'Versione Flux',
|
||||
subtitle: versionText.isNotEmpty
|
||||
? '$versionText • Tocca per verificare aggiornamenti'
|
||||
: 'Verifica disponibilità aggiornamenti',
|
||||
context: context,
|
||||
onTap: () => UpdatePromptHelper.showManualUpdateCheck(context),
|
||||
);
|
||||
},
|
||||
),
|
||||
]),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/features/operations/data/operations_repository.dart';
|
||||
import 'package:flux/features/targets/blocs/target_detail_state.dart';
|
||||
import 'package:flux/features/targets/data/target_progress_service.dart';
|
||||
import 'package:flux/features/targets/data/targets_repository.dart';
|
||||
import 'package:flux/features/targets/models/target_model.dart';
|
||||
import 'package:flux/service_locator.dart';
|
||||
|
||||
class TargetDetailCubit extends Cubit<TargetDetailState> {
|
||||
final TargetProgressService _progressService;
|
||||
final TargetsRepository _targetsRepository;
|
||||
final OperationsRepository _operationsRepository;
|
||||
StreamSubscription<void>? _targetsSub;
|
||||
StreamSubscription<void>? _operationsSub;
|
||||
|
||||
TargetDetailCubit({
|
||||
required TargetModel target,
|
||||
TargetProgressService? progressService,
|
||||
TargetsRepository? targetsRepository,
|
||||
OperationsRepository? operationsRepository,
|
||||
}) : _progressService = progressService ?? sl<TargetProgressService>(),
|
||||
_targetsRepository = targetsRepository ?? sl<TargetsRepository>(),
|
||||
_operationsRepository = operationsRepository ?? sl<OperationsRepository>(),
|
||||
super(
|
||||
TargetDetailState(
|
||||
target: target,
|
||||
status: TargetDetailStatus.initial,
|
||||
),
|
||||
) {
|
||||
_targetsSub = _targetsRepository.onTargetsChanged.listen((_) {
|
||||
refresh();
|
||||
});
|
||||
_operationsSub = _operationsRepository.onOperationsChanged.listen((_) {
|
||||
refresh();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
_targetsSub?.cancel();
|
||||
_operationsSub?.cancel();
|
||||
return super.close();
|
||||
}
|
||||
|
||||
Future<void> init() async {
|
||||
emit(state.copyWith(status: TargetDetailStatus.loading));
|
||||
await refresh();
|
||||
}
|
||||
|
||||
Future<void> refresh() async {
|
||||
try {
|
||||
final progress = await _progressService.calculateTargetProgress(
|
||||
target: state.target,
|
||||
);
|
||||
emit(
|
||||
state.copyWith(
|
||||
progress: progress,
|
||||
status: TargetDetailStatus.ready,
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: TargetDetailStatus.failure,
|
||||
errorMessage: 'Errore durante il calcolo dell\'avanzamento: $e',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void setActiveTab(int index) {
|
||||
emit(state.copyWith(activeTab: index));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flux/features/targets/models/target_model.dart';
|
||||
import 'package:flux/features/targets/models/target_progress_model.dart';
|
||||
|
||||
enum TargetDetailStatus { initial, loading, ready, failure }
|
||||
|
||||
class TargetDetailState extends Equatable {
|
||||
final TargetDetailStatus status;
|
||||
final TargetModel target;
|
||||
final TargetProgressModel? progress;
|
||||
final int activeTab;
|
||||
final String? errorMessage;
|
||||
|
||||
const TargetDetailState({
|
||||
this.status = TargetDetailStatus.initial,
|
||||
required this.target,
|
||||
this.progress,
|
||||
this.activeTab = 0,
|
||||
this.errorMessage,
|
||||
});
|
||||
|
||||
TargetDetailState copyWith({
|
||||
TargetDetailStatus? status,
|
||||
TargetModel? target,
|
||||
TargetProgressModel? progress,
|
||||
int? activeTab,
|
||||
String? errorMessage,
|
||||
}) {
|
||||
return TargetDetailState(
|
||||
status: status ?? this.status,
|
||||
target: target ?? this.target,
|
||||
progress: progress ?? this.progress,
|
||||
activeTab: activeTab ?? this.activeTab,
|
||||
errorMessage: errorMessage,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
status,
|
||||
target,
|
||||
progress,
|
||||
activeTab,
|
||||
errorMessage,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,352 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/features/master_data/staff/blocs/staff_cubit.dart';
|
||||
import 'package:flux/features/master_data/staff/data/staff_repository.dart';
|
||||
import 'package:flux/features/master_data/staff/models/staff_member_model.dart';
|
||||
import 'package:flux/features/targets/blocs/target_form_state.dart';
|
||||
import 'package:flux/features/targets/data/targets_repository.dart';
|
||||
import 'package:flux/features/targets/models/individual_target_model.dart';
|
||||
import 'package:flux/features/targets/models/target_metrics.dart';
|
||||
import 'package:flux/features/targets/models/target_model.dart';
|
||||
|
||||
class TargetFormCubit extends Cubit<TargetFormState> {
|
||||
final TargetsRepository _targetsRepository;
|
||||
final StaffRepository _staffRepository;
|
||||
final StaffCubit _staffCubit;
|
||||
|
||||
TargetFormCubit({
|
||||
required TargetsRepository targetsRepository,
|
||||
required StaffRepository staffRepository,
|
||||
required StaffCubit staffCubit,
|
||||
}) : _targetsRepository = targetsRepository,
|
||||
_staffRepository = staffRepository,
|
||||
_staffCubit = staffCubit,
|
||||
super(
|
||||
TargetFormState(
|
||||
target: TargetModel.empty(),
|
||||
status: TargetFormStatus.initial,
|
||||
),
|
||||
);
|
||||
|
||||
Future<void> init({
|
||||
TargetModel? initialTarget,
|
||||
required String companyId,
|
||||
required String defaultStoreId,
|
||||
}) async {
|
||||
emit(state.copyWith(status: TargetFormStatus.loading));
|
||||
try {
|
||||
final now = DateTime.now();
|
||||
final defaultStart = DateTime(now.year, now.month, 1);
|
||||
final defaultEnd = DateTime(now.year, now.month + 1, 0, 23, 59, 59);
|
||||
|
||||
final isEditing = initialTarget != null;
|
||||
final target =
|
||||
initialTarget ??
|
||||
TargetModel(
|
||||
companyId: companyId,
|
||||
storeId: defaultStoreId,
|
||||
startDay: defaultStart,
|
||||
endDay: defaultEnd,
|
||||
metrics: const TargetMetrics(),
|
||||
);
|
||||
|
||||
final storeId = target.storeId ?? defaultStoreId;
|
||||
final storeStaff = await _loadStoreStaff(companyId, storeId);
|
||||
|
||||
// Costruisci o allinea individualTargets per ogni membro dello staff
|
||||
final List<IndividualTargetModel> individuals = [];
|
||||
for (final staff in storeStaff) {
|
||||
if (staff.id == null) continue;
|
||||
final existing = target.individualTargets.firstWhere(
|
||||
(it) => it.staffId == staff.id,
|
||||
orElse:
|
||||
() => IndividualTargetModel(
|
||||
companyId: companyId,
|
||||
targetId: target.id ?? '',
|
||||
staffId: staff.id!,
|
||||
staff: staff,
|
||||
metrics: const TargetMetrics(),
|
||||
),
|
||||
);
|
||||
individuals.add(
|
||||
existing.copyWith(staff: staff, companyId: companyId),
|
||||
);
|
||||
}
|
||||
|
||||
emit(
|
||||
state.copyWith(
|
||||
target: target,
|
||||
individualTargets: individuals,
|
||||
storeStaff: storeStaff,
|
||||
isEditing: isEditing,
|
||||
status: TargetFormStatus.ready,
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
debugPrint('Errore init TargetFormCubit: $e');
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: TargetFormStatus.failure,
|
||||
errorMessage: 'Errore nel caricamento della form: $e',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<StaffMemberModel>> _loadStoreStaff(
|
||||
String companyId,
|
||||
String storeId,
|
||||
) async {
|
||||
try {
|
||||
// 1. Assicuriamoci che StaffCubit abbia caricato i dati di base
|
||||
if (_staffCubit.state.allStaff.isEmpty &&
|
||||
_staffCubit.state.status != StaffStatus.loading) {
|
||||
await _staffCubit.loadAllStaff();
|
||||
}
|
||||
|
||||
// 2. Chiediamo a StaffCubit di caricare lo staff per questo specifico negozio
|
||||
if (storeId.isNotEmpty) {
|
||||
await _staffCubit.loadStaffForStore(storeId);
|
||||
}
|
||||
|
||||
// 3. Verifichiamo se StaffCubit ha addetti per questo negozio
|
||||
List<StaffMemberModel> staff =
|
||||
storeId.isNotEmpty ? (_staffCubit.state.staffByStore[storeId] ?? []) : [];
|
||||
|
||||
// 4. Se la lista è vuota, proviamo la query diretta sulla tabella di giunzione
|
||||
if (staff.isEmpty && storeId.isNotEmpty) {
|
||||
staff = await _staffRepository.getStaffMembersInStore(storeId);
|
||||
}
|
||||
|
||||
// 5. Se trovati addetti assegnati al negozio, ritorniamo quelli attivi
|
||||
final activeStoreStaff = staff.where((s) => s.isActive).toList();
|
||||
if (activeStoreStaff.isNotEmpty) {
|
||||
return activeStoreStaff;
|
||||
}
|
||||
|
||||
// 6. Fallback: controlliamo se in allStaff di StaffCubit qualcuno ha questo store associato
|
||||
final matchedInAllStaff = _staffCubit.state.allStaff.where((s) {
|
||||
return s.isActive &&
|
||||
(s.assignedStoreIds.contains(storeId) ||
|
||||
s.assignedStores.any((st) => st.id == storeId));
|
||||
}).toList();
|
||||
|
||||
if (matchedInAllStaff.isNotEmpty) {
|
||||
return matchedInAllStaff;
|
||||
}
|
||||
|
||||
// 7. Se non c'è ancora alcuna assegnazione specifica (es. singolo store aziendale),
|
||||
// usiamo tutti gli addetti attivi presenti in StaffCubit
|
||||
final allCompanyStaff = _staffCubit.state.allStaff.where((s) => s.isActive).toList();
|
||||
if (allCompanyStaff.isNotEmpty) {
|
||||
return allCompanyStaff;
|
||||
}
|
||||
|
||||
// 8. Fallback estremo: query al repository
|
||||
final repoStaff = await _staffRepository.getStaffMembers(companyId);
|
||||
return repoStaff.where((s) => s.isActive).toList();
|
||||
} catch (e) {
|
||||
debugPrint('Errore nel recupero dello staff per store $storeId: $e');
|
||||
return _staffCubit.state.allStaff.where((s) => s.isActive).toList();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> setStore(String storeId) async {
|
||||
if (state.target.storeId == storeId) return;
|
||||
emit(state.copyWith(status: TargetFormStatus.loading));
|
||||
try {
|
||||
final updatedTarget = state.target.copyWith(storeId: storeId);
|
||||
final storeStaff = await _loadStoreStaff(
|
||||
state.target.companyId,
|
||||
storeId,
|
||||
);
|
||||
|
||||
final List<IndividualTargetModel> individuals = [];
|
||||
for (final staff in storeStaff) {
|
||||
if (staff.id == null) continue;
|
||||
individuals.add(
|
||||
IndividualTargetModel(
|
||||
companyId: state.target.companyId,
|
||||
targetId: state.target.id ?? '',
|
||||
staffId: staff.id!,
|
||||
staff: staff,
|
||||
metrics: const TargetMetrics(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
emit(
|
||||
state.copyWith(
|
||||
target: updatedTarget,
|
||||
storeStaff: storeStaff,
|
||||
individualTargets: individuals,
|
||||
status: TargetFormStatus.ready,
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: TargetFormStatus.ready,
|
||||
errorMessage: 'Errore nel caricamento dello staff del negozio',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void setDateRange(DateTime start, DateTime end) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
target: state.target.copyWith(startDay: start, endDay: end),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void setDescription(String description) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
target: state.target.copyWith(description: description),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void updateStoreMetrics(TargetMetrics metrics) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
target: state.target.copyWith(metrics: metrics),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void updateIndividualMetrics(String staffId, TargetMetrics metrics) {
|
||||
final updated =
|
||||
state.individualTargets.map((it) {
|
||||
if (it.staffId == staffId) {
|
||||
return it.copyWith(metrics: metrics);
|
||||
}
|
||||
return it;
|
||||
}).toList();
|
||||
|
||||
emit(state.copyWith(individualTargets: updated));
|
||||
}
|
||||
|
||||
/// Distribuisce le metriche del target di negozio tra gli addetti specificati tramite mappa dei pesi.
|
||||
/// [staffWeights] mappa staffId -> peso (es. 1.0 per full-time, 0.5 per part-time).
|
||||
/// Gli addetti con peso <= 0 o esclusi vengono azzerati.
|
||||
void distributeMetrics({
|
||||
required Map<String, double> staffWeights,
|
||||
}) {
|
||||
final activeEntries = staffWeights.entries.where((e) => e.value > 0).toList();
|
||||
if (activeEntries.isEmpty) return;
|
||||
|
||||
final totalWeight = activeEntries.fold<double>(0.0, (sum, e) => sum + e.value);
|
||||
if (totalWeight <= 0) return;
|
||||
|
||||
final m = state.target.metrics;
|
||||
|
||||
final updated = state.individualTargets.map((it) {
|
||||
final weight = staffWeights[it.staffId] ?? 0.0;
|
||||
if (weight <= 0) {
|
||||
return it.copyWith(metrics: const TargetMetrics());
|
||||
}
|
||||
|
||||
final ratio = weight / totalWeight;
|
||||
int calc(int val) => (val * ratio).floor();
|
||||
|
||||
final distributedMetrics = TargetMetrics(
|
||||
mnp1: calc(m.mnp1),
|
||||
mnp2: calc(m.mnp2),
|
||||
unica1: calc(m.unica1),
|
||||
unica2: calc(m.unica2),
|
||||
nip1: calc(m.nip1),
|
||||
nip2: calc(m.nip2),
|
||||
business1: calc(m.business1),
|
||||
business2: calc(m.business2),
|
||||
contenuti1: calc(m.contenuti1),
|
||||
contenuti2: calc(m.contenuti2),
|
||||
calcio1: calc(m.calcio1),
|
||||
calcio2: calc(m.calcio2),
|
||||
fin1: calc(m.fin1),
|
||||
fin2: calc(m.fin2),
|
||||
upselling1: calc(m.upselling1),
|
||||
upselling2: calc(m.upselling2),
|
||||
cb1: calc(m.cb1),
|
||||
cb2: calc(m.cb2),
|
||||
al1: calc(m.al1),
|
||||
al2: calc(m.al2),
|
||||
telepass1: calc(m.telepass1),
|
||||
telepass2: calc(m.telepass2),
|
||||
energiaTim1: calc(m.energiaTim1),
|
||||
energiaTim2: calc(m.energiaTim2),
|
||||
energiaAltri1: calc(m.energiaAltri1),
|
||||
energiaAltri2: calc(m.energiaAltri2),
|
||||
ricontatti1: calc(m.ricontatti1),
|
||||
ricontatti2: calc(m.ricontatti2),
|
||||
);
|
||||
|
||||
return it.copyWith(metrics: distributedMetrics);
|
||||
}).toList();
|
||||
|
||||
emit(state.copyWith(individualTargets: updated));
|
||||
}
|
||||
|
||||
/// Distribuisce equamente le metriche del target di negozio tra tutti gli addetti
|
||||
void distributeMetricsEqually() {
|
||||
final weights = {
|
||||
for (final it in state.individualTargets) it.staffId: 1.0,
|
||||
};
|
||||
distributeMetrics(staffWeights: weights);
|
||||
}
|
||||
|
||||
void setActiveTab(int tab) {
|
||||
emit(state.copyWith(activeTab: tab));
|
||||
}
|
||||
|
||||
Future<bool> save() async {
|
||||
if (state.target.storeId == null || state.target.storeId!.isEmpty) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
errorMessage: 'Seleziona un negozio per questo target',
|
||||
),
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
emit(state.copyWith(status: TargetFormStatus.saving));
|
||||
try {
|
||||
// 1. Salva il target di negozio
|
||||
final savedStoreTarget = await _targetsRepository.saveStoreTarget(
|
||||
state.target,
|
||||
);
|
||||
|
||||
// 2. Prepara e salva gli individualTargets collegati a savedStoreTarget.id
|
||||
if (savedStoreTarget.id != null && state.individualTargets.isNotEmpty) {
|
||||
final toSave =
|
||||
state.individualTargets.map((it) {
|
||||
return it.copyWith(
|
||||
targetId: savedStoreTarget.id!,
|
||||
companyId: savedStoreTarget.companyId,
|
||||
);
|
||||
}).toList();
|
||||
|
||||
await _targetsRepository.saveIndividualTargets(toSave);
|
||||
}
|
||||
|
||||
emit(
|
||||
state.copyWith(
|
||||
target: savedStoreTarget,
|
||||
status: TargetFormStatus.success,
|
||||
),
|
||||
);
|
||||
return true;
|
||||
} catch (e) {
|
||||
debugPrint('Errore salvataggio target: $e');
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: TargetFormStatus.failure,
|
||||
errorMessage: 'Errore durante il salvataggio: $e',
|
||||
),
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flux/features/master_data/staff/models/staff_member_model.dart';
|
||||
import 'package:flux/features/targets/models/individual_target_model.dart';
|
||||
import 'package:flux/features/targets/models/target_model.dart';
|
||||
|
||||
enum TargetFormStatus {
|
||||
initial,
|
||||
loading,
|
||||
ready,
|
||||
saving,
|
||||
success,
|
||||
failure,
|
||||
}
|
||||
|
||||
class TargetFormState extends Equatable {
|
||||
final TargetModel target;
|
||||
final List<IndividualTargetModel> individualTargets;
|
||||
final List<StaffMemberModel> storeStaff;
|
||||
final TargetFormStatus status;
|
||||
final String? errorMessage;
|
||||
final bool isEditing;
|
||||
final int activeTab; // 0: Obiettivi Negozio, 1: Quote Addetti
|
||||
|
||||
const TargetFormState({
|
||||
required this.target,
|
||||
this.individualTargets = const [],
|
||||
this.storeStaff = const [],
|
||||
this.status = TargetFormStatus.initial,
|
||||
this.errorMessage,
|
||||
this.isEditing = false,
|
||||
this.activeTab = 0,
|
||||
});
|
||||
|
||||
TargetFormState copyWith({
|
||||
TargetModel? target,
|
||||
List<IndividualTargetModel>? individualTargets,
|
||||
List<StaffMemberModel>? storeStaff,
|
||||
TargetFormStatus? status,
|
||||
String? errorMessage,
|
||||
bool? isEditing,
|
||||
int? activeTab,
|
||||
}) {
|
||||
return TargetFormState(
|
||||
target: target ?? this.target,
|
||||
individualTargets: individualTargets ?? this.individualTargets,
|
||||
storeStaff: storeStaff ?? this.storeStaff,
|
||||
status: status ?? this.status,
|
||||
errorMessage: errorMessage,
|
||||
isEditing: isEditing ?? this.isEditing,
|
||||
activeTab: activeTab ?? this.activeTab,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
target,
|
||||
individualTargets,
|
||||
storeStaff,
|
||||
status,
|
||||
errorMessage,
|
||||
isEditing,
|
||||
activeTab,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
import 'dart:async';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/features/operations/data/operations_repository.dart';
|
||||
import 'package:flux/features/targets/data/target_progress_service.dart';
|
||||
import 'package:flux/features/targets/data/targets_repository.dart';
|
||||
import 'package:flux/features/targets/models/target_model.dart';
|
||||
import 'package:flux/features/targets/models/target_progress_model.dart';
|
||||
import 'package:flux/service_locator.dart';
|
||||
|
||||
part 'target_list_state.dart';
|
||||
|
||||
class TargetListCubit extends Cubit<TargetListState> {
|
||||
final TargetsRepository _repository = sl<TargetsRepository>();
|
||||
final OperationsRepository _operationsRepository = sl<OperationsRepository>();
|
||||
final TargetProgressService _progressService = sl<TargetProgressService>();
|
||||
final SessionCubit _sessionCubit = sl<SessionCubit>();
|
||||
StreamSubscription<void>? _targetsSub;
|
||||
StreamSubscription<void>? _operationsSub;
|
||||
|
||||
TargetListCubit() : super(const TargetListState()) {
|
||||
_targetsSub = _repository.onTargetsChanged.listen((_) {
|
||||
loadTargets();
|
||||
});
|
||||
_operationsSub = _operationsRepository.onOperationsChanged.listen((_) {
|
||||
loadTargets();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
_targetsSub?.cancel();
|
||||
_operationsSub?.cancel();
|
||||
return super.close();
|
||||
}
|
||||
|
||||
Future<void> loadTargets({String? storeId, DateTime? month}) async {
|
||||
final companyId = _sessionCubit.state.company?.id;
|
||||
if (companyId == null) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: TargetListStatus.failure,
|
||||
errorMessage: 'Nessuna azienda associata alla sessione',
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
emit(state.copyWith(status: TargetListStatus.loading));
|
||||
|
||||
final effectiveStoreId = storeId ?? state.selectedStoreId;
|
||||
final effectiveMonth = month ?? state.selectedMonth;
|
||||
|
||||
DateTime? fromDate;
|
||||
DateTime? toDate;
|
||||
if (effectiveMonth != null) {
|
||||
fromDate = DateTime(effectiveMonth.year, effectiveMonth.month, 1);
|
||||
toDate = DateTime(
|
||||
effectiveMonth.year,
|
||||
effectiveMonth.month + 1,
|
||||
0,
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
final targets = await _repository.getStoreTargets(
|
||||
companyId: companyId,
|
||||
storeId: effectiveStoreId,
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
);
|
||||
|
||||
// Calcolo progressi e ritmi per ciascun target trovato
|
||||
final progressMap = <String, TargetProgressModel>{};
|
||||
for (final target in targets) {
|
||||
if (target.id != null) {
|
||||
final progress = await _progressService.calculateTargetProgress(
|
||||
target: target,
|
||||
);
|
||||
progressMap[target.id!] = progress;
|
||||
}
|
||||
}
|
||||
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: TargetListStatus.success,
|
||||
targets: targets,
|
||||
progressMap: progressMap,
|
||||
selectedStoreId: () => effectiveStoreId,
|
||||
selectedMonth: () => effectiveMonth,
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: TargetListStatus.failure,
|
||||
errorMessage: e.toString(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void filterByStore(String? storeId) {
|
||||
loadTargets(storeId: storeId);
|
||||
}
|
||||
|
||||
void filterByMonth(DateTime? month) {
|
||||
loadTargets(month: month);
|
||||
}
|
||||
|
||||
Future<bool> deleteTarget(String id) async {
|
||||
try {
|
||||
await _repository.deleteStoreTarget(id);
|
||||
return true;
|
||||
} catch (e) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
status: TargetListStatus.failure,
|
||||
errorMessage: "Errore durante l'eliminazione del target: $e",
|
||||
),
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
part of 'target_list_cubit.dart';
|
||||
|
||||
enum TargetListStatus { initial, loading, success, failure }
|
||||
|
||||
class TargetListState extends Equatable {
|
||||
final TargetListStatus status;
|
||||
final List<TargetModel> targets;
|
||||
final Map<String, TargetProgressModel> progressMap;
|
||||
final String? selectedStoreId;
|
||||
final DateTime? selectedMonth;
|
||||
final String? errorMessage;
|
||||
|
||||
const TargetListState({
|
||||
this.status = TargetListStatus.initial,
|
||||
this.targets = const [],
|
||||
this.progressMap = const {},
|
||||
this.selectedStoreId,
|
||||
this.selectedMonth,
|
||||
this.errorMessage,
|
||||
});
|
||||
|
||||
TargetListState copyWith({
|
||||
TargetListStatus? status,
|
||||
List<TargetModel>? targets,
|
||||
Map<String, TargetProgressModel>? progressMap,
|
||||
String? Function()? selectedStoreId,
|
||||
DateTime? Function()? selectedMonth,
|
||||
String? errorMessage,
|
||||
}) {
|
||||
return TargetListState(
|
||||
status: status ?? this.status,
|
||||
targets: targets ?? this.targets,
|
||||
progressMap: progressMap ?? this.progressMap,
|
||||
selectedStoreId:
|
||||
selectedStoreId != null ? selectedStoreId() : this.selectedStoreId,
|
||||
selectedMonth:
|
||||
selectedMonth != null ? selectedMonth() : this.selectedMonth,
|
||||
errorMessage: errorMessage,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
status,
|
||||
targets,
|
||||
progressMap,
|
||||
selectedStoreId,
|
||||
selectedMonth,
|
||||
errorMessage,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,336 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flux/core/enums_and_consts/consts.dart';
|
||||
import 'package:flux/core/utils/working_days_helper.dart';
|
||||
import 'package:flux/features/operations/models/operation_type.dart';
|
||||
import 'package:flux/features/targets/models/target_metrics.dart';
|
||||
import 'package:flux/features/targets/models/target_model.dart';
|
||||
import 'package:flux/features/targets/models/target_progress_model.dart';
|
||||
import 'package:flux/service_locator.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
class TargetProgressService {
|
||||
final SupabaseClient _supabase;
|
||||
|
||||
TargetProgressService({SupabaseClient? supabase})
|
||||
: _supabase = supabase ?? sl<SupabaseClient>();
|
||||
|
||||
static const List<({String key, String label})> metricDefinitions = [
|
||||
(key: 'mnp', label: 'MNP'),
|
||||
(key: 'unica', label: 'TIM Unica'),
|
||||
(key: 'nip', label: 'NIP'),
|
||||
(key: 'business', label: 'Business'),
|
||||
(key: 'contenuti', label: 'Contenuti'),
|
||||
(key: 'calcio', label: 'Calcio'),
|
||||
(key: 'fin', label: 'Finanziamenti'),
|
||||
(key: 'upselling', label: 'Upselling'),
|
||||
(key: 'cb', label: 'Customer Base'),
|
||||
(key: 'al', label: 'Attivazioni Linea'),
|
||||
(key: 'telepass', label: 'Telepass'),
|
||||
(key: 'energiaTim', label: 'Energia TIM'),
|
||||
(key: 'energiaAltri', label: 'Energia Non TIM'),
|
||||
(key: 'ricontatti', label: 'Ricontatti / Bollette'),
|
||||
];
|
||||
|
||||
/// Calcola l'avanzamento completo per un target (di negozio e per ciascun addetto)
|
||||
Future<TargetProgressModel> calculateTargetProgress({
|
||||
required TargetModel target,
|
||||
DateTime? now,
|
||||
}) async {
|
||||
final effectiveNow = now ?? DateTime.now();
|
||||
|
||||
// 1. Calcolo giorni lavorativi con esclusione di domeniche e festivi
|
||||
final days = WorkingDaysHelper.calculateWorkingDaysPeriod(
|
||||
start: target.startDay,
|
||||
end: target.endDay,
|
||||
now: effectiveNow,
|
||||
);
|
||||
|
||||
// 2. Query su operations nel periodo target per lo store
|
||||
final storeCounts = <String, int>{};
|
||||
final staffCounts = <String, Map<String, int>>{};
|
||||
|
||||
// Inizializza contatori
|
||||
for (final def in metricDefinitions) {
|
||||
storeCounts[def.key] = 0;
|
||||
}
|
||||
|
||||
try {
|
||||
final storeId = target.storeId;
|
||||
if (storeId != null && storeId.isNotEmpty) {
|
||||
final response = await _supabase
|
||||
.from(Tables.operations)
|
||||
.select('''
|
||||
id,
|
||||
store_id,
|
||||
staff_id,
|
||||
created_at,
|
||||
status,
|
||||
is_business,
|
||||
${Tables.operationDetails}(
|
||||
type,
|
||||
sub_type,
|
||||
provider_id,
|
||||
${Tables.providers}(name)
|
||||
)
|
||||
''')
|
||||
.eq('company_id', target.companyId)
|
||||
.eq('store_id', storeId)
|
||||
.neq('status', 'failure')
|
||||
.gte('created_at', target.startDay.toIso8601String())
|
||||
.lte('created_at', target.endDay.toIso8601String());
|
||||
|
||||
final operations = response as List<dynamic>;
|
||||
|
||||
for (final op in operations) {
|
||||
final staffId = op['staff_id'] as String?;
|
||||
final isBusinessOp = op['is_business'] as bool? ?? false;
|
||||
final details = op[Tables.operationDetails] as List<dynamic>? ?? [];
|
||||
|
||||
if (staffId != null && !staffCounts.containsKey(staffId)) {
|
||||
staffCounts[staffId] = {
|
||||
for (final def in metricDefinitions) def.key: 0,
|
||||
};
|
||||
}
|
||||
|
||||
for (final d in details) {
|
||||
final typeStr = d['type'] as String?;
|
||||
final opType = OperationType.fromValue(typeStr);
|
||||
final subType = (d['sub_type'] as String?)?.trim().toLowerCase();
|
||||
final providerMap = d[Tables.providers] as Map<String, dynamic>?;
|
||||
final providerName = (providerMap?['name'] as String?)?.toLowerCase() ?? '';
|
||||
|
||||
final categoryKey = _mapDetailToCategory(
|
||||
opType: opType,
|
||||
subType: subType,
|
||||
providerName: providerName,
|
||||
isBusinessOp: isBusinessOp,
|
||||
);
|
||||
|
||||
if (categoryKey != null && storeCounts.containsKey(categoryKey)) {
|
||||
storeCounts[categoryKey] = (storeCounts[categoryKey] ?? 0) + 1;
|
||||
if (staffId != null && staffCounts.containsKey(staffId)) {
|
||||
staffCounts[staffId]![categoryKey] =
|
||||
(staffCounts[staffId]![categoryKey] ?? 0) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
debugPrint('Errore nel caricamento delle operazioni per il target: $e');
|
||||
}
|
||||
|
||||
// 3. Costruzione CategoryProgress per il negozio
|
||||
final storeCategories = <String, CategoryProgress>{};
|
||||
for (final def in metricDefinitions) {
|
||||
final actual = storeCounts[def.key] ?? 0;
|
||||
final targets = _extractTargetS1S2(target.metrics, def.key);
|
||||
|
||||
storeCategories[def.key] = CategoryProgress.calculate(
|
||||
key: def.key,
|
||||
label: def.label,
|
||||
actual: actual,
|
||||
s1: targets.s1,
|
||||
s2: targets.s2,
|
||||
elapsedDays: days.elapsed,
|
||||
remainingDays: days.remaining,
|
||||
totalDays: days.total,
|
||||
);
|
||||
}
|
||||
|
||||
// 4. Costruzione avanzamento per singoli addetti
|
||||
final staffProgressMap = <String, TargetProgressModel>{};
|
||||
final individualTargetsList = target.individualTargets;
|
||||
|
||||
final bool hasExplicitIndividualTargets = individualTargetsList.any(
|
||||
(it) => it.metrics.totalLevel1 > 0 || it.metrics.totalLevel2 > 0,
|
||||
);
|
||||
|
||||
final int staffCount = individualTargetsList.isNotEmpty
|
||||
? individualTargetsList.length
|
||||
: (staffCounts.isNotEmpty ? staffCounts.length : 1);
|
||||
|
||||
for (final it in individualTargetsList) {
|
||||
final sId = it.staffId;
|
||||
final sCounts = staffCounts[sId] ?? {};
|
||||
final sCategories = <String, CategoryProgress>{};
|
||||
|
||||
for (final def in metricDefinitions) {
|
||||
final actual = sCounts[def.key] ?? 0;
|
||||
({int s1, int s2}) targets;
|
||||
|
||||
if (hasExplicitIndividualTargets) {
|
||||
targets = _extractTargetS1S2(it.metrics, def.key);
|
||||
} else {
|
||||
// Se non sono stati assegnati target individuali, dividi equamente il target del negozio
|
||||
final storeTargets = _extractTargetS1S2(target.metrics, def.key);
|
||||
targets = (
|
||||
s1: staffCount > 0
|
||||
? (storeTargets.s1 / staffCount).round()
|
||||
: storeTargets.s1,
|
||||
s2: staffCount > 0
|
||||
? (storeTargets.s2 / staffCount).round()
|
||||
: storeTargets.s2,
|
||||
);
|
||||
}
|
||||
|
||||
sCategories[def.key] = CategoryProgress.calculate(
|
||||
key: def.key,
|
||||
label: def.label,
|
||||
actual: actual,
|
||||
s1: targets.s1,
|
||||
s2: targets.s2,
|
||||
elapsedDays: days.elapsed,
|
||||
remainingDays: days.remaining,
|
||||
totalDays: days.total,
|
||||
);
|
||||
}
|
||||
|
||||
staffProgressMap[sId] = TargetProgressModel(
|
||||
targetId: target.id ?? '',
|
||||
storeId: target.storeId,
|
||||
staffId: sId,
|
||||
staffName: it.staff?.name,
|
||||
totalWorkingDays: days.total,
|
||||
elapsedWorkingDays: days.elapsed,
|
||||
remainingWorkingDays: days.remaining,
|
||||
categories: sCategories,
|
||||
);
|
||||
}
|
||||
|
||||
// Se ci sono addetti con operazioni che non compaiono in individualTargets, creiamo la loro scheda
|
||||
for (final sId in staffCounts.keys) {
|
||||
if (!staffProgressMap.containsKey(sId)) {
|
||||
final sCounts = staffCounts[sId] ?? {};
|
||||
final sCategories = <String, CategoryProgress>{};
|
||||
|
||||
for (final def in metricDefinitions) {
|
||||
final actual = sCounts[def.key] ?? 0;
|
||||
final storeTargets = _extractTargetS1S2(target.metrics, def.key);
|
||||
final targets = (
|
||||
s1: staffCount > 0
|
||||
? (storeTargets.s1 / staffCount).round()
|
||||
: storeTargets.s1,
|
||||
s2: staffCount > 0
|
||||
? (storeTargets.s2 / staffCount).round()
|
||||
: storeTargets.s2,
|
||||
);
|
||||
|
||||
sCategories[def.key] = CategoryProgress.calculate(
|
||||
key: def.key,
|
||||
label: def.label,
|
||||
actual: actual,
|
||||
s1: targets.s1,
|
||||
s2: targets.s2,
|
||||
elapsedDays: days.elapsed,
|
||||
remainingDays: days.remaining,
|
||||
totalDays: days.total,
|
||||
);
|
||||
}
|
||||
|
||||
staffProgressMap[sId] = TargetProgressModel(
|
||||
targetId: target.id ?? '',
|
||||
storeId: target.storeId,
|
||||
staffId: sId,
|
||||
totalWorkingDays: days.total,
|
||||
elapsedWorkingDays: days.elapsed,
|
||||
remainingWorkingDays: days.remaining,
|
||||
categories: sCategories,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return TargetProgressModel(
|
||||
targetId: target.id ?? '',
|
||||
storeId: target.storeId,
|
||||
totalWorkingDays: days.total,
|
||||
elapsedWorkingDays: days.elapsed,
|
||||
remainingWorkingDays: days.remaining,
|
||||
categories: storeCategories,
|
||||
staffProgress: staffProgressMap,
|
||||
);
|
||||
}
|
||||
|
||||
/// Mappa un dettaglio operazione alla chiave di metrica target corrispondente
|
||||
String? _mapDetailToCategory({
|
||||
required OperationType? opType,
|
||||
required String? subType,
|
||||
required String providerName,
|
||||
required bool isBusinessOp,
|
||||
}) {
|
||||
if (opType == null) return null;
|
||||
|
||||
if (opType == OperationType.business || isBusinessOp) {
|
||||
return 'business';
|
||||
}
|
||||
|
||||
switch (opType) {
|
||||
case OperationType.mnp:
|
||||
return 'mnp';
|
||||
case OperationType.unica:
|
||||
return 'unica';
|
||||
case OperationType.nip:
|
||||
return 'nip';
|
||||
case OperationType.entertainment:
|
||||
if (subType == 'calcio') {
|
||||
return 'calcio';
|
||||
}
|
||||
return 'contenuti';
|
||||
case OperationType.fin:
|
||||
return 'fin';
|
||||
case OperationType.upselling:
|
||||
return 'upselling';
|
||||
case OperationType.cb:
|
||||
return 'cb';
|
||||
case OperationType.al:
|
||||
return 'al';
|
||||
case OperationType.telepass:
|
||||
return 'telepass';
|
||||
case OperationType.energy:
|
||||
if (providerName.contains('tim')) {
|
||||
return 'energiaTim';
|
||||
}
|
||||
return 'energiaAltri';
|
||||
case OperationType.ricontatto:
|
||||
return 'ricontatti';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// Estrae i valori di Soglia 1 e Soglia 2 per la specifica categoria da TargetMetrics
|
||||
({int s1, int s2}) _extractTargetS1S2(TargetMetrics m, String key) {
|
||||
switch (key) {
|
||||
case 'mnp':
|
||||
return (s1: m.mnp1, s2: m.mnp2);
|
||||
case 'unica':
|
||||
return (s1: m.unica1, s2: m.unica2);
|
||||
case 'nip':
|
||||
return (s1: m.nip1, s2: m.nip2);
|
||||
case 'business':
|
||||
return (s1: m.business1, s2: m.business2);
|
||||
case 'contenuti':
|
||||
return (s1: m.contenuti1, s2: m.contenuti2);
|
||||
case 'calcio':
|
||||
return (s1: m.calcio1, s2: m.calcio2);
|
||||
case 'fin':
|
||||
return (s1: m.fin1, s2: m.fin2);
|
||||
case 'upselling':
|
||||
return (s1: m.upselling1, s2: m.upselling2);
|
||||
case 'cb':
|
||||
return (s1: m.cb1, s2: m.cb2);
|
||||
case 'al':
|
||||
return (s1: m.al1, s2: m.al2);
|
||||
case 'telepass':
|
||||
return (s1: m.telepass1, s2: m.telepass2);
|
||||
case 'energiaTim':
|
||||
return (s1: m.energiaTim1, s2: m.energiaTim2);
|
||||
case 'energiaAltri':
|
||||
return (s1: m.energiaAltri1, s2: m.energiaAltri2);
|
||||
case 'ricontatti':
|
||||
return (s1: m.ricontatti1, s2: m.ricontatti2);
|
||||
default:
|
||||
return (s1: 0, s2: 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flux/core/enums_and_consts/consts.dart';
|
||||
import 'package:flux/features/targets/models/individual_target_model.dart';
|
||||
import 'package:flux/features/targets/models/target_model.dart';
|
||||
import 'package:flux/service_locator.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
class TargetsRepository {
|
||||
final SupabaseClient _supabase = sl<SupabaseClient>();
|
||||
|
||||
final StreamController<void> _targetsChangedController =
|
||||
StreamController<void>.broadcast();
|
||||
|
||||
Stream<void> get onTargetsChanged => _targetsChangedController.stream;
|
||||
|
||||
void notifyTargetsChanged() {
|
||||
if (!_targetsChangedController.isClosed) {
|
||||
_targetsChangedController.add(null);
|
||||
}
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// STORE TARGETS (Tabella 'targets')
|
||||
// ==========================================
|
||||
|
||||
Future<TargetModel?> getStoreTargetById(String id) async {
|
||||
try {
|
||||
final response = await _supabase
|
||||
.from(Tables.targets)
|
||||
.select('''
|
||||
*,
|
||||
${Tables.stores}(*),
|
||||
${Tables.individualTargets}(
|
||||
*,
|
||||
${Tables.staffMembers}(*)
|
||||
)
|
||||
''')
|
||||
.eq('id', id)
|
||||
.single();
|
||||
return TargetModel.fromMap(response);
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore getStoreTargetById: $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<TargetModel>> getStoreTargets({
|
||||
required String companyId,
|
||||
String? storeId,
|
||||
DateTime? fromDate,
|
||||
DateTime? toDate,
|
||||
}) async {
|
||||
try {
|
||||
var query = _supabase
|
||||
.from(Tables.targets)
|
||||
.select('''
|
||||
*,
|
||||
${Tables.stores}(*),
|
||||
${Tables.individualTargets}(
|
||||
*,
|
||||
${Tables.staffMembers}(*)
|
||||
)
|
||||
''')
|
||||
.eq('company_id', companyId);
|
||||
|
||||
if (storeId != null && storeId.isNotEmpty) {
|
||||
query = query.eq('store_id', storeId);
|
||||
}
|
||||
|
||||
if (fromDate != null) {
|
||||
query = query.gte('end_day', fromDate.toIso8601String());
|
||||
}
|
||||
|
||||
if (toDate != null) {
|
||||
query = query.lte('start_day', toDate.toIso8601String());
|
||||
}
|
||||
|
||||
final response = await query.order('start_day', ascending: false);
|
||||
return (response as List<dynamic>)
|
||||
.map((e) => TargetModel.fromMap(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore getStoreTargets: $e');
|
||||
throw Exception('Errore nel recupero degli obiettivi di negozio: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<TargetModel?> getStoreTargetForMonth({
|
||||
required String companyId,
|
||||
required String storeId,
|
||||
required DateTime month,
|
||||
}) async {
|
||||
try {
|
||||
final firstDay = DateTime(month.year, month.month, 1);
|
||||
final lastDay = DateTime(month.year, month.month + 1, 0, 23, 59, 59);
|
||||
|
||||
final response = await _supabase
|
||||
.from(Tables.targets)
|
||||
.select('''
|
||||
*,
|
||||
${Tables.stores}(*),
|
||||
${Tables.individualTargets}(
|
||||
*,
|
||||
${Tables.staffMembers}(*)
|
||||
)
|
||||
''')
|
||||
.eq('company_id', companyId)
|
||||
.eq('store_id', storeId)
|
||||
.gte('end_day', firstDay.toIso8601String())
|
||||
.lte('start_day', lastDay.toIso8601String())
|
||||
.order('start_day', ascending: false)
|
||||
.limit(1)
|
||||
.maybeSingle();
|
||||
|
||||
if (response == null) return null;
|
||||
return TargetModel.fromMap(response);
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore getStoreTargetForMonth: $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<TargetModel> saveStoreTarget(TargetModel target) async {
|
||||
try {
|
||||
final Map<String, dynamic> data = target.toMap();
|
||||
final response = await _supabase
|
||||
.from(Tables.targets)
|
||||
.upsert(data)
|
||||
.select('''
|
||||
*,
|
||||
${Tables.stores}(*),
|
||||
${Tables.individualTargets}(
|
||||
*,
|
||||
${Tables.staffMembers}(*)
|
||||
)
|
||||
''')
|
||||
.single();
|
||||
|
||||
notifyTargetsChanged();
|
||||
return TargetModel.fromMap(response);
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore saveStoreTarget: $e');
|
||||
throw Exception('Errore nel salvataggio dell\'obiettivo di negozio: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> deleteStoreTarget(String id) async {
|
||||
try {
|
||||
await _supabase.from(Tables.targets).delete().eq('id', id);
|
||||
notifyTargetsChanged();
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore deleteStoreTarget: $e');
|
||||
throw Exception('Errore nell\'eliminazione dell\'obiettivo di negozio: $e');
|
||||
}
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// INDIVIDUAL TARGETS (Tabella 'individual_targets')
|
||||
// ==========================================
|
||||
|
||||
Future<IndividualTargetModel?> getIndividualTargetById(String id) async {
|
||||
try {
|
||||
final response = await _supabase
|
||||
.from(Tables.individualTargets)
|
||||
.select('''
|
||||
*,
|
||||
${Tables.staffMembers}(*)
|
||||
''')
|
||||
.eq('id', id)
|
||||
.single();
|
||||
return IndividualTargetModel.fromMap(response);
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore getIndividualTargetById: $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<IndividualTargetModel>> getIndividualTargets({
|
||||
required String companyId,
|
||||
String? targetId,
|
||||
String? staffId,
|
||||
}) async {
|
||||
try {
|
||||
var query = _supabase
|
||||
.from(Tables.individualTargets)
|
||||
.select('''
|
||||
*,
|
||||
${Tables.staffMembers}(*)
|
||||
''')
|
||||
.eq('company_id', companyId);
|
||||
|
||||
if (targetId != null && targetId.isNotEmpty) {
|
||||
query = query.eq('target_id', targetId);
|
||||
}
|
||||
|
||||
if (staffId != null && staffId.isNotEmpty) {
|
||||
query = query.eq('staff_id', staffId);
|
||||
}
|
||||
|
||||
final response = await query.order('created_at', ascending: false);
|
||||
return (response as List<dynamic>)
|
||||
.map((e) => IndividualTargetModel.fromMap(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore getIndividualTargets: $e');
|
||||
throw Exception('Errore nel recupero degli obiettivi individuali: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<IndividualTargetModel?> getIndividualTargetForStaffAndTarget({
|
||||
required String companyId,
|
||||
required String targetId,
|
||||
required String staffId,
|
||||
}) async {
|
||||
try {
|
||||
final response = await _supabase
|
||||
.from(Tables.individualTargets)
|
||||
.select('''
|
||||
*,
|
||||
${Tables.staffMembers}(*)
|
||||
''')
|
||||
.eq('company_id', companyId)
|
||||
.eq('target_id', targetId)
|
||||
.eq('staff_id', staffId)
|
||||
.maybeSingle();
|
||||
|
||||
if (response == null) return null;
|
||||
return IndividualTargetModel.fromMap(response);
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore getIndividualTargetForStaffAndTarget: $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<IndividualTargetModel> saveIndividualTarget(
|
||||
IndividualTargetModel target,
|
||||
) async {
|
||||
try {
|
||||
final Map<String, dynamic> data = target.toMap();
|
||||
final response = await _supabase
|
||||
.from(Tables.individualTargets)
|
||||
.upsert(data)
|
||||
.select('''
|
||||
*,
|
||||
${Tables.staffMembers}(*)
|
||||
''')
|
||||
.single();
|
||||
|
||||
notifyTargetsChanged();
|
||||
return IndividualTargetModel.fromMap(response);
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore saveIndividualTarget: $e');
|
||||
throw Exception('Errore nel salvataggio dell\'obiettivo individuale: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<IndividualTargetModel>> saveIndividualTargets(
|
||||
List<IndividualTargetModel> targets,
|
||||
) async {
|
||||
if (targets.isEmpty) return [];
|
||||
try {
|
||||
final List<Map<String, dynamic>> data =
|
||||
targets.map((t) => t.toMap()).toList();
|
||||
final response = await _supabase
|
||||
.from(Tables.individualTargets)
|
||||
.upsert(data)
|
||||
.select('''
|
||||
*,
|
||||
${Tables.staffMembers}(*)
|
||||
''');
|
||||
|
||||
notifyTargetsChanged();
|
||||
return (response as List<dynamic>)
|
||||
.map((e) => IndividualTargetModel.fromMap(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore saveIndividualTargets: $e');
|
||||
throw Exception('Errore nel salvataggio degli obiettivi individuali: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> deleteIndividualTarget(String id) async {
|
||||
try {
|
||||
await _supabase.from(Tables.individualTargets).delete().eq('id', id);
|
||||
notifyTargetsChanged();
|
||||
} on Exception catch (e) {
|
||||
debugPrint('Errore deleteIndividualTarget: $e');
|
||||
throw Exception('Errore nell\'eliminazione dell\'obiettivo individuale: $e');
|
||||
}
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
_targetsChangedController.close();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flux/core/enums_and_consts/consts.dart';
|
||||
import 'package:flux/features/master_data/staff/models/staff_member_model.dart';
|
||||
import 'target_metrics.dart';
|
||||
|
||||
class IndividualTargetModel extends Equatable {
|
||||
final String? id;
|
||||
final DateTime? createdAt;
|
||||
final String targetId;
|
||||
final String companyId;
|
||||
final String staffId;
|
||||
final StaffMemberModel? staff;
|
||||
final String? description;
|
||||
final TargetMetrics metrics;
|
||||
|
||||
const IndividualTargetModel({
|
||||
this.id,
|
||||
this.createdAt,
|
||||
required this.targetId,
|
||||
required this.companyId,
|
||||
required this.staffId,
|
||||
this.staff,
|
||||
this.description,
|
||||
this.metrics = const TargetMetrics(),
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
createdAt,
|
||||
targetId,
|
||||
companyId,
|
||||
staffId,
|
||||
staff,
|
||||
description,
|
||||
metrics,
|
||||
];
|
||||
|
||||
IndividualTargetModel copyWith({
|
||||
String? id,
|
||||
DateTime? createdAt,
|
||||
String? targetId,
|
||||
String? companyId,
|
||||
String? staffId,
|
||||
StaffMemberModel? staff,
|
||||
String? description,
|
||||
TargetMetrics? metrics,
|
||||
}) {
|
||||
return IndividualTargetModel(
|
||||
id: id ?? this.id,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
targetId: targetId ?? this.targetId,
|
||||
companyId: companyId ?? this.companyId,
|
||||
staffId: staffId ?? this.staffId,
|
||||
staff: staff ?? this.staff,
|
||||
description: description ?? this.description,
|
||||
metrics: metrics ?? this.metrics,
|
||||
);
|
||||
}
|
||||
|
||||
factory IndividualTargetModel.empty({
|
||||
String targetId = '',
|
||||
String companyId = '',
|
||||
String staffId = '',
|
||||
}) {
|
||||
return IndividualTargetModel(
|
||||
targetId: targetId,
|
||||
companyId: companyId,
|
||||
staffId: staffId,
|
||||
metrics: TargetMetrics.empty(),
|
||||
);
|
||||
}
|
||||
|
||||
factory IndividualTargetModel.fromMap(Map<String, dynamic> map) {
|
||||
return IndividualTargetModel(
|
||||
id: map['id'] as String?,
|
||||
createdAt:
|
||||
map['created_at'] != null
|
||||
? DateTime.parse(map['created_at'] as String)
|
||||
: null,
|
||||
targetId: map['target_id'] as String? ?? '',
|
||||
companyId: map['company_id'] as String? ?? '',
|
||||
staffId: map['staff_id'] as String? ?? '',
|
||||
staff:
|
||||
map[Tables.staffMembers] != null
|
||||
? StaffMemberModel.fromMap(
|
||||
map[Tables.staffMembers] as Map<String, dynamic>,
|
||||
)
|
||||
: null,
|
||||
description: map['description'] as String?,
|
||||
metrics:
|
||||
map['metrics'] != null && map['metrics'] is Map<String, dynamic>
|
||||
? TargetMetrics.fromMap(map['metrics'] as Map<String, dynamic>)
|
||||
: TargetMetrics.fromMap(map),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
if (id != null && id!.isNotEmpty) 'id': id,
|
||||
'target_id': targetId,
|
||||
'company_id': companyId,
|
||||
'staff_id': staffId,
|
||||
'description': description,
|
||||
'metrics': metrics.toMap(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,305 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class TargetMetrics extends Equatable {
|
||||
final int mnp1;
|
||||
final int mnp2;
|
||||
final int unica1;
|
||||
final int unica2;
|
||||
final int nip1;
|
||||
final int nip2;
|
||||
final int business1;
|
||||
final int business2;
|
||||
final int contenuti1;
|
||||
final int contenuti2;
|
||||
final int calcio1;
|
||||
final int calcio2;
|
||||
final int fin1;
|
||||
final int fin2;
|
||||
final int upselling1;
|
||||
final int upselling2;
|
||||
final int cb1;
|
||||
final int cb2;
|
||||
final int al1;
|
||||
final int al2;
|
||||
final int telepass1;
|
||||
final int telepass2;
|
||||
final int energiaTim1;
|
||||
final int energiaTim2;
|
||||
final int energiaAltri1;
|
||||
final int energiaAltri2;
|
||||
final int ricontatti1;
|
||||
final int ricontatti2;
|
||||
|
||||
// Getter di compatibilità con codice pregresso
|
||||
int get energiaTim => energiaTim1;
|
||||
int get energiaAltri => energiaAltri1;
|
||||
|
||||
const TargetMetrics({
|
||||
this.mnp1 = 0,
|
||||
this.mnp2 = 0,
|
||||
this.unica1 = 0,
|
||||
this.unica2 = 0,
|
||||
this.nip1 = 0,
|
||||
this.nip2 = 0,
|
||||
this.business1 = 0,
|
||||
this.business2 = 0,
|
||||
this.contenuti1 = 0,
|
||||
this.contenuti2 = 0,
|
||||
this.calcio1 = 0,
|
||||
this.calcio2 = 0,
|
||||
this.fin1 = 0,
|
||||
this.fin2 = 0,
|
||||
this.upselling1 = 0,
|
||||
this.upselling2 = 0,
|
||||
this.cb1 = 0,
|
||||
this.cb2 = 0,
|
||||
this.al1 = 0,
|
||||
this.al2 = 0,
|
||||
this.telepass1 = 0,
|
||||
this.telepass2 = 0,
|
||||
int? energiaTim1,
|
||||
int? energiaTim,
|
||||
this.energiaTim2 = 0,
|
||||
int? energiaAltri1,
|
||||
int? energiaAltri,
|
||||
this.energiaAltri2 = 0,
|
||||
this.ricontatti1 = 0,
|
||||
this.ricontatti2 = 0,
|
||||
}) : energiaTim1 = energiaTim1 ?? energiaTim ?? 0,
|
||||
energiaAltri1 = energiaAltri1 ?? energiaAltri ?? 0;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
mnp1,
|
||||
mnp2,
|
||||
unica1,
|
||||
unica2,
|
||||
nip1,
|
||||
nip2,
|
||||
business1,
|
||||
business2,
|
||||
contenuti1,
|
||||
contenuti2,
|
||||
calcio1,
|
||||
calcio2,
|
||||
fin1,
|
||||
fin2,
|
||||
upselling1,
|
||||
upselling2,
|
||||
cb1,
|
||||
cb2,
|
||||
al1,
|
||||
al2,
|
||||
telepass1,
|
||||
telepass2,
|
||||
energiaTim1,
|
||||
energiaTim2,
|
||||
energiaAltri1,
|
||||
energiaAltri2,
|
||||
ricontatti1,
|
||||
ricontatti2,
|
||||
];
|
||||
|
||||
TargetMetrics copyWith({
|
||||
int? mnp1,
|
||||
int? mnp2,
|
||||
int? unica1,
|
||||
int? unica2,
|
||||
int? nip1,
|
||||
int? nip2,
|
||||
int? business1,
|
||||
int? business2,
|
||||
int? contenuti1,
|
||||
int? contenuti2,
|
||||
int? calcio1,
|
||||
int? calcio2,
|
||||
int? fin1,
|
||||
int? fin2,
|
||||
int? upselling1,
|
||||
int? upselling2,
|
||||
int? cb1,
|
||||
int? cb2,
|
||||
int? al1,
|
||||
int? al2,
|
||||
int? telepass1,
|
||||
int? telepass2,
|
||||
int? energiaTim1,
|
||||
int? energiaTim,
|
||||
int? energiaTim2,
|
||||
int? energiaAltri1,
|
||||
int? energiaAltri,
|
||||
int? energiaAltri2,
|
||||
int? ricontatti1,
|
||||
int? ricontatti2,
|
||||
}) {
|
||||
return TargetMetrics(
|
||||
mnp1: mnp1 ?? this.mnp1,
|
||||
mnp2: mnp2 ?? this.mnp2,
|
||||
unica1: unica1 ?? this.unica1,
|
||||
unica2: unica2 ?? this.unica2,
|
||||
nip1: nip1 ?? this.nip1,
|
||||
nip2: nip2 ?? this.nip2,
|
||||
business1: business1 ?? this.business1,
|
||||
business2: business2 ?? this.business2,
|
||||
contenuti1: contenuti1 ?? this.contenuti1,
|
||||
contenuti2: contenuti2 ?? this.contenuti2,
|
||||
calcio1: calcio1 ?? this.calcio1,
|
||||
calcio2: calcio2 ?? this.calcio2,
|
||||
fin1: fin1 ?? this.fin1,
|
||||
fin2: fin2 ?? this.fin2,
|
||||
upselling1: upselling1 ?? this.upselling1,
|
||||
upselling2: upselling2 ?? this.upselling2,
|
||||
cb1: cb1 ?? this.cb1,
|
||||
cb2: cb2 ?? this.cb2,
|
||||
al1: al1 ?? this.al1,
|
||||
al2: al2 ?? this.al2,
|
||||
telepass1: telepass1 ?? this.telepass1,
|
||||
telepass2: telepass2 ?? this.telepass2,
|
||||
energiaTim1: energiaTim1 ?? energiaTim ?? this.energiaTim1,
|
||||
energiaTim2: energiaTim2 ?? this.energiaTim2,
|
||||
energiaAltri1: energiaAltri1 ?? energiaAltri ?? this.energiaAltri1,
|
||||
energiaAltri2: energiaAltri2 ?? this.energiaAltri2,
|
||||
ricontatti1: ricontatti1 ?? this.ricontatti1,
|
||||
ricontatti2: ricontatti2 ?? this.ricontatti2,
|
||||
);
|
||||
}
|
||||
|
||||
factory TargetMetrics.empty() {
|
||||
return const TargetMetrics();
|
||||
}
|
||||
|
||||
factory TargetMetrics.fromMap(Map<String, dynamic> map) {
|
||||
return TargetMetrics(
|
||||
mnp1: (map['mnp_1'] as num?)?.toInt() ?? 0,
|
||||
mnp2: (map['mnp_2'] as num?)?.toInt() ?? 0,
|
||||
unica1: (map['unica_1'] as num?)?.toInt() ?? 0,
|
||||
unica2: (map['unica_2'] as num?)?.toInt() ?? 0,
|
||||
nip1: (map['nip_1'] as num?)?.toInt() ?? 0,
|
||||
nip2: (map['nip_2'] as num?)?.toInt() ?? 0,
|
||||
business1: (map['business_1'] as num?)?.toInt() ?? 0,
|
||||
business2: (map['business_2'] as num?)?.toInt() ?? 0,
|
||||
contenuti1: (map['contenuti_1'] as num?)?.toInt() ?? 0,
|
||||
contenuti2: (map['contenuti_2'] as num?)?.toInt() ?? 0,
|
||||
calcio1: (map['calcio_1'] as num?)?.toInt() ?? 0,
|
||||
calcio2: (map['calcio_2'] as num?)?.toInt() ?? 0,
|
||||
fin1: (map['fin_1'] as num?)?.toInt() ?? 0,
|
||||
fin2: (map['fin_2'] as num?)?.toInt() ?? 0,
|
||||
upselling1: (map['upselling_1'] as num?)?.toInt() ?? 0,
|
||||
upselling2: (map['upselling_2'] as num?)?.toInt() ?? 0,
|
||||
cb1: (map['cb_1'] as num?)?.toInt() ?? 0,
|
||||
cb2: (map['cb_2'] as num?)?.toInt() ?? 0,
|
||||
al1: (map['al_1'] as num?)?.toInt() ?? 0,
|
||||
al2: (map['al_2'] as num?)?.toInt() ?? 0,
|
||||
telepass1: (map['telepass_1'] as num?)?.toInt() ?? 0,
|
||||
telepass2: (map['telepass_2'] as num?)?.toInt() ?? 0,
|
||||
energiaTim1: (map['energia_tim_1'] as num?)?.toInt() ??
|
||||
(map['energia_tim'] as num?)?.toInt() ??
|
||||
(map['Energia_tim'] as num?)?.toInt() ??
|
||||
0,
|
||||
energiaTim2: (map['energia_tim_2'] as num?)?.toInt() ??
|
||||
(map['Energia_tim_2'] as num?)?.toInt() ??
|
||||
0,
|
||||
energiaAltri1: (map['energia_altri_1'] as num?)?.toInt() ??
|
||||
(map['energia_altri'] as num?)?.toInt() ??
|
||||
(map['Energia_altri'] as num?)?.toInt() ??
|
||||
0,
|
||||
energiaAltri2: (map['energia_altri_2'] as num?)?.toInt() ??
|
||||
(map['Energia_altri_2'] as num?)?.toInt() ??
|
||||
0,
|
||||
ricontatti1: (map['ricontatti_1'] as num?)?.toInt() ??
|
||||
(map['ricontatti'] as num?)?.toInt() ??
|
||||
0,
|
||||
ricontatti2: (map['ricontatti_2'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'mnp_1': mnp1,
|
||||
'mnp_2': mnp2,
|
||||
'unica_1': unica1,
|
||||
'unica_2': unica2,
|
||||
'nip_1': nip1,
|
||||
'nip_2': nip2,
|
||||
'business_1': business1,
|
||||
'business_2': business2,
|
||||
'contenuti_1': contenuti1,
|
||||
'contenuti_2': contenuti2,
|
||||
if (calcio1 > 0) 'calcio_1': calcio1,
|
||||
if (calcio2 > 0) 'calcio_2': calcio2,
|
||||
'fin_1': fin1,
|
||||
'fin_2': fin2,
|
||||
'upselling_1': upselling1,
|
||||
'upselling_2': upselling2,
|
||||
'cb_1': cb1,
|
||||
'cb_2': cb2,
|
||||
'al_1': al1,
|
||||
'al_2': al2,
|
||||
'telepass_1': telepass1,
|
||||
'telepass_2': telepass2,
|
||||
'energia_tim_1': energiaTim1,
|
||||
'energia_tim_2': energiaTim2,
|
||||
'energia_tim': energiaTim1,
|
||||
'energia_altri_1': energiaAltri1,
|
||||
'energia_altri_2': energiaAltri2,
|
||||
'energia_altri': energiaAltri1,
|
||||
'ricontatti_1': ricontatti1,
|
||||
'ricontatti_2': ricontatti2,
|
||||
'ricontatti': ricontatti1,
|
||||
};
|
||||
}
|
||||
|
||||
/// Somma totale di tutti i target del Livello 1 (inclusa energia e ricontatti)
|
||||
int get totalLevel1 =>
|
||||
mnp1 +
|
||||
unica1 +
|
||||
nip1 +
|
||||
business1 +
|
||||
contenuti1 +
|
||||
calcio1 +
|
||||
fin1 +
|
||||
upselling1 +
|
||||
cb1 +
|
||||
al1 +
|
||||
telepass1 +
|
||||
energiaTim1 +
|
||||
energiaAltri1 +
|
||||
ricontatti1;
|
||||
|
||||
/// Somma totale di tutti i target del Livello 2 (inclusa energia e ricontatti)
|
||||
int get totalLevel2 =>
|
||||
mnp2 +
|
||||
unica2 +
|
||||
nip2 +
|
||||
business2 +
|
||||
contenuti2 +
|
||||
calcio2 +
|
||||
fin2 +
|
||||
upselling2 +
|
||||
cb2 +
|
||||
al2 +
|
||||
telepass2 +
|
||||
energiaTim2 +
|
||||
energiaAltri2 +
|
||||
ricontatti2;
|
||||
|
||||
/// Numero di categorie con almeno una soglia impostata (> 0)
|
||||
int get activeMetricsCount {
|
||||
int count = 0;
|
||||
if (mnp1 > 0 || mnp2 > 0) count++;
|
||||
if (unica1 > 0 || unica2 > 0) count++;
|
||||
if (nip1 > 0 || nip2 > 0) count++;
|
||||
if (business1 > 0 || business2 > 0) count++;
|
||||
if (contenuti1 > 0 || contenuti2 > 0) count++;
|
||||
if (calcio1 > 0 || calcio2 > 0) count++;
|
||||
if (fin1 > 0 || fin2 > 0) count++;
|
||||
if (upselling1 > 0 || upselling2 > 0) count++;
|
||||
if (cb1 > 0 || cb2 > 0) count++;
|
||||
if (al1 > 0 || al2 > 0) count++;
|
||||
if (telepass1 > 0 || telepass2 > 0) count++;
|
||||
if (energiaTim1 > 0 || energiaTim2 > 0) count++;
|
||||
if (energiaAltri1 > 0 || energiaAltri2 > 0) count++;
|
||||
if (ricontatti1 > 0 || ricontatti2 > 0) count++;
|
||||
return count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flux/core/enums_and_consts/consts.dart';
|
||||
import 'package:flux/features/master_data/store/models/store_model.dart';
|
||||
import 'individual_target_model.dart';
|
||||
import 'target_metrics.dart';
|
||||
|
||||
class TargetModel extends Equatable {
|
||||
final String? id;
|
||||
final DateTime? createdAt;
|
||||
final DateTime startDay;
|
||||
final DateTime endDay;
|
||||
final String? description;
|
||||
final String companyId;
|
||||
final String? storeId;
|
||||
final StoreModel? store;
|
||||
final TargetMetrics metrics;
|
||||
final List<IndividualTargetModel> individualTargets;
|
||||
|
||||
const TargetModel({
|
||||
this.id,
|
||||
this.createdAt,
|
||||
required this.startDay,
|
||||
required this.endDay,
|
||||
this.description,
|
||||
required this.companyId,
|
||||
this.storeId,
|
||||
this.store,
|
||||
this.metrics = const TargetMetrics(),
|
||||
this.individualTargets = const [],
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
createdAt,
|
||||
startDay,
|
||||
endDay,
|
||||
description,
|
||||
companyId,
|
||||
storeId,
|
||||
store,
|
||||
metrics,
|
||||
individualTargets,
|
||||
];
|
||||
|
||||
TargetModel copyWith({
|
||||
String? id,
|
||||
DateTime? createdAt,
|
||||
DateTime? startDay,
|
||||
DateTime? endDay,
|
||||
String? description,
|
||||
String? companyId,
|
||||
String? storeId,
|
||||
StoreModel? store,
|
||||
TargetMetrics? metrics,
|
||||
List<IndividualTargetModel>? individualTargets,
|
||||
}) {
|
||||
return TargetModel(
|
||||
id: id ?? this.id,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
startDay: startDay ?? this.startDay,
|
||||
endDay: endDay ?? this.endDay,
|
||||
description: description ?? this.description,
|
||||
companyId: companyId ?? this.companyId,
|
||||
storeId: storeId ?? this.storeId,
|
||||
store: store ?? this.store,
|
||||
metrics: metrics ?? this.metrics,
|
||||
individualTargets: individualTargets ?? this.individualTargets,
|
||||
);
|
||||
}
|
||||
|
||||
factory TargetModel.empty({
|
||||
String companyId = '',
|
||||
String? storeId,
|
||||
DateTime? startDay,
|
||||
DateTime? endDay,
|
||||
}) {
|
||||
final now = DateTime.now();
|
||||
final firstDayOfMonth = DateTime(now.year, now.month, 1);
|
||||
final lastDayOfMonth = DateTime(now.year, now.month + 1, 0, 23, 59, 59);
|
||||
|
||||
return TargetModel(
|
||||
startDay: startDay ?? firstDayOfMonth,
|
||||
endDay: endDay ?? lastDayOfMonth,
|
||||
companyId: companyId,
|
||||
storeId: storeId,
|
||||
metrics: TargetMetrics.empty(),
|
||||
individualTargets: const [],
|
||||
);
|
||||
}
|
||||
|
||||
factory TargetModel.fromMap(Map<String, dynamic> map) {
|
||||
return TargetModel(
|
||||
id: map['id'] as String?,
|
||||
createdAt:
|
||||
map['created_at'] != null
|
||||
? DateTime.parse(map['created_at'] as String)
|
||||
: null,
|
||||
startDay: DateTime.parse(map['start_day'] as String),
|
||||
endDay: DateTime.parse(map['end_day'] as String),
|
||||
description: map['description'] as String?,
|
||||
companyId: map['company_id'] as String? ?? '',
|
||||
storeId: map['store_id'] as String?,
|
||||
store:
|
||||
map[Tables.stores] != null
|
||||
? StoreModel.fromMap(map[Tables.stores] as Map<String, dynamic>)
|
||||
: null,
|
||||
metrics:
|
||||
map['metrics'] != null && map['metrics'] is Map<String, dynamic>
|
||||
? TargetMetrics.fromMap(map['metrics'] as Map<String, dynamic>)
|
||||
: TargetMetrics.fromMap(map),
|
||||
individualTargets:
|
||||
map[Tables.individualTargets] != null &&
|
||||
map[Tables.individualTargets] is List<dynamic>
|
||||
? (map[Tables.individualTargets] as List<dynamic>)
|
||||
.map(
|
||||
(e) =>
|
||||
IndividualTargetModel.fromMap(e as Map<String, dynamic>),
|
||||
)
|
||||
.toList()
|
||||
: const [],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
if (id != null && id!.isNotEmpty) 'id': id,
|
||||
'start_day': startDay.toIso8601String(),
|
||||
'end_day': endDay.toIso8601String(),
|
||||
'description': description,
|
||||
'company_id': companyId,
|
||||
if (storeId != null && storeId!.isNotEmpty) 'store_id': storeId,
|
||||
'metrics': metrics.toMap(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Stato di avanzamento sul ritmo di ciascuna metrica
|
||||
enum TargetPacingStatus {
|
||||
/// In linea con lo sfidante o già superato (VERDE PIENO)
|
||||
inLineS2(label: 'In linea Sfidante', emoji: '🚀'),
|
||||
|
||||
/// In linea con il minimo o già raggiunto (VERDINO)
|
||||
inLineS1(label: 'In linea Minimo', emoji: '✅'),
|
||||
|
||||
/// Sotto ritmo ma vicino/recuperabile (ROSA)
|
||||
recoverable(label: 'Da spingere', emoji: '⚡'),
|
||||
|
||||
/// Sotto ritmo grave o fermo (ROSSO)
|
||||
critical(label: 'Critico', emoji: '🔴'),
|
||||
|
||||
/// Nessun obiettivo impostato per questa categoria
|
||||
notSet(label: 'Non impostato', emoji: '—');
|
||||
|
||||
final String label;
|
||||
final String emoji;
|
||||
|
||||
const TargetPacingStatus({required this.label, required this.emoji});
|
||||
}
|
||||
|
||||
/// Avanzamento e ritmo su una singola metrica/categoria di obiettivo
|
||||
class CategoryProgress extends Equatable {
|
||||
final String key;
|
||||
final String label;
|
||||
final int actualPieces;
|
||||
final int targetS1;
|
||||
final int targetS2;
|
||||
final TargetPacingStatus status;
|
||||
final double actualDailyRate;
|
||||
final double requiredDailyRateS1;
|
||||
final double requiredDailyRateS2;
|
||||
final double projectedPieces;
|
||||
|
||||
const CategoryProgress({
|
||||
required this.key,
|
||||
required this.label,
|
||||
required this.actualPieces,
|
||||
required this.targetS1,
|
||||
required this.targetS2,
|
||||
required this.status,
|
||||
required this.actualDailyRate,
|
||||
required this.requiredDailyRateS1,
|
||||
required this.requiredDailyRateS2,
|
||||
required this.projectedPieces,
|
||||
});
|
||||
|
||||
/// Calcola il progresso di una singola metrica dati i giorni lavorativi
|
||||
factory CategoryProgress.calculate({
|
||||
required String key,
|
||||
required String label,
|
||||
required int actual,
|
||||
required int s1,
|
||||
required int s2,
|
||||
required int elapsedDays,
|
||||
required int remainingDays,
|
||||
required int totalDays,
|
||||
}) {
|
||||
if (s1 == 0 && s2 == 0) {
|
||||
return CategoryProgress(
|
||||
key: key,
|
||||
label: label,
|
||||
actualPieces: actual,
|
||||
targetS1: 0,
|
||||
targetS2: 0,
|
||||
status: TargetPacingStatus.notSet,
|
||||
actualDailyRate: elapsedDays > 0 ? (actual / elapsedDays) : 0.0,
|
||||
requiredDailyRateS1: 0.0,
|
||||
requiredDailyRateS2: 0.0,
|
||||
projectedPieces: elapsedDays > 0 ? (actual / elapsedDays) * totalDays : 0.0,
|
||||
);
|
||||
}
|
||||
|
||||
final actualDaily = elapsedDays > 0 ? (actual / elapsedDays) : 0.0;
|
||||
final projected = actualDaily * totalDays;
|
||||
|
||||
final remainingPiecesS1 = s1 > actual ? (s1 - actual) : 0;
|
||||
final remainingPiecesS2 = s2 > actual ? (s2 - actual) : 0;
|
||||
|
||||
final reqDailyS1 = remainingDays > 0 ? (remainingPiecesS1 / remainingDays) : 0.0;
|
||||
final reqDailyS2 = remainingDays > 0 ? (remainingPiecesS2 / remainingDays) : 0.0;
|
||||
|
||||
// Determinazione dello stato di pacing cromatico a 4 livelli
|
||||
TargetPacingStatus status;
|
||||
if (elapsedDays == 0) {
|
||||
status = TargetPacingStatus.inLineS1;
|
||||
} else if (s2 > 0 && (actual >= s2 || projected >= s2)) {
|
||||
status = TargetPacingStatus.inLineS2; // Verde pieno
|
||||
} else if (actual >= s1 || projected >= s1) {
|
||||
status = TargetPacingStatus.inLineS1; // Verdino
|
||||
} else if (s1 > 0 && projected >= (s1 * 0.55)) {
|
||||
status = TargetPacingStatus.recoverable; // Rosa (da spingere)
|
||||
} else {
|
||||
status = TargetPacingStatus.critical; // Rosso (critico)
|
||||
}
|
||||
|
||||
return CategoryProgress(
|
||||
key: key,
|
||||
label: label,
|
||||
actualPieces: actual,
|
||||
targetS1: s1,
|
||||
targetS2: s2,
|
||||
status: status,
|
||||
actualDailyRate: actualDaily,
|
||||
requiredDailyRateS1: reqDailyS1,
|
||||
requiredDailyRateS2: reqDailyS2,
|
||||
projectedPieces: projected,
|
||||
);
|
||||
}
|
||||
|
||||
/// Ha un target attivo (> 0) impostato
|
||||
bool get hasTarget => targetS1 > 0 || targetS2 > 0;
|
||||
|
||||
/// Obiettivo Soglia 2 già raggiunto/preso nei pezzi
|
||||
bool get isAchievedS2 => targetS2 > 0 && actualPieces >= targetS2;
|
||||
|
||||
/// Obiettivo Soglia 1 già raggiunto/preso nei pezzi
|
||||
bool get isAchievedS1 => targetS1 > 0 && actualPieces >= targetS1;
|
||||
|
||||
/// Obiettivo già raggiunto/preso (almeno Soglia 1)
|
||||
bool get isAchieved => isAchievedS1 || isAchievedS2;
|
||||
|
||||
/// In linea con il ritmo di marcia ma non ancora formalmente raggiunto
|
||||
bool get isInLineOnly =>
|
||||
!isAchieved &&
|
||||
(status == TargetPacingStatus.inLineS1 ||
|
||||
status == TargetPacingStatus.inLineS2);
|
||||
|
||||
/// Sotto ritmo ma recuperabile (ROSA)
|
||||
bool get isRecoverable => status == TargetPacingStatus.recoverable;
|
||||
|
||||
/// In forte ritardo critico o fermo (ROSSO)
|
||||
bool get isCritical => status == TargetPacingStatus.critical;
|
||||
|
||||
/// Sotto ritmo complessivo (Rosa o Rosso)
|
||||
bool get isBehind => isRecoverable || isCritical;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
key,
|
||||
label,
|
||||
actualPieces,
|
||||
targetS1,
|
||||
targetS2,
|
||||
status,
|
||||
actualDailyRate,
|
||||
requiredDailyRateS1,
|
||||
requiredDailyRateS2,
|
||||
projectedPieces,
|
||||
];
|
||||
}
|
||||
|
||||
/// Modello aggregato di avanzamento target per il negozio o per singolo addetto
|
||||
class TargetProgressModel extends Equatable {
|
||||
final String targetId;
|
||||
final String? storeId;
|
||||
final String? staffId;
|
||||
final String? staffName;
|
||||
final int totalWorkingDays;
|
||||
final int elapsedWorkingDays;
|
||||
final int remainingWorkingDays;
|
||||
final Map<String, CategoryProgress> categories;
|
||||
final Map<String, TargetProgressModel> staffProgress;
|
||||
|
||||
const TargetProgressModel({
|
||||
required this.targetId,
|
||||
this.storeId,
|
||||
this.staffId,
|
||||
this.staffName,
|
||||
required this.totalWorkingDays,
|
||||
required this.elapsedWorkingDays,
|
||||
required this.remainingWorkingDays,
|
||||
required this.categories,
|
||||
this.staffProgress = const {},
|
||||
});
|
||||
|
||||
factory TargetProgressModel.empty() => const TargetProgressModel(
|
||||
targetId: '',
|
||||
totalWorkingDays: 0,
|
||||
elapsedWorkingDays: 0,
|
||||
remainingWorkingDays: 0,
|
||||
categories: {},
|
||||
staffProgress: {},
|
||||
);
|
||||
|
||||
/// Somma di tutti i pezzi realizzati finora
|
||||
int get totalActualPieces =>
|
||||
categories.values.fold(0, (sum, c) => sum + c.actualPieces);
|
||||
|
||||
/// Totale pezzi obiettivo Soglia 1
|
||||
int get totalTargetS1 =>
|
||||
categories.values.fold(0, (sum, c) => sum + c.targetS1);
|
||||
|
||||
/// Totale pezzi obiettivo Soglia 2
|
||||
int get totalTargetS2 =>
|
||||
categories.values.fold(0, (sum, c) => sum + c.targetS2);
|
||||
|
||||
/// Numero di obiettivi già raggiunti/presi (almeno Soglia 1)
|
||||
int get countAchieved =>
|
||||
categories.values.where((c) => c.isAchieved).length;
|
||||
|
||||
/// Numero di obiettivi già raggiunti in Soglia 2 (Sfidante)
|
||||
int get countAchievedS2 =>
|
||||
categories.values.where((c) => c.isAchievedS2).length;
|
||||
|
||||
/// Numero di obiettivi già raggiunti in Soglia 1 ma non ancora in Soglia 2
|
||||
int get countAchievedS1 =>
|
||||
categories.values.where((c) => c.isAchievedS1 && !c.isAchievedS2).length;
|
||||
|
||||
/// Numero di obiettivi non ancora raggiunti ma attualmente in linea con il ritmo
|
||||
int get countInLineOnly =>
|
||||
categories.values.where((c) => c.isInLineOnly).length;
|
||||
|
||||
/// Numero di obiettivi in linea o già raggiunti in Soglia 2
|
||||
int get countInLineS2 => categories.values
|
||||
.where((c) => c.status == TargetPacingStatus.inLineS2)
|
||||
.length;
|
||||
|
||||
/// Numero di obiettivi in linea o già raggiunti in Soglia 1
|
||||
int get countInLineS1 => categories.values
|
||||
.where((c) => c.status == TargetPacingStatus.inLineS1)
|
||||
.length;
|
||||
|
||||
/// Numero di obiettivi sotto ritmo ma vicini/recuperabili (ROSA)
|
||||
int get countRecoverable => categories.values
|
||||
.where((c) => c.status == TargetPacingStatus.recoverable)
|
||||
.length;
|
||||
|
||||
/// Numero di obiettivi in forte ritardo o fermi (ROSSO)
|
||||
int get countCritical => categories.values
|
||||
.where((c) => c.status == TargetPacingStatus.critical)
|
||||
.length;
|
||||
|
||||
/// Numero totale di obiettivi sotto ritmo (Rosa + Rosso)
|
||||
int get countBehind => countRecoverable + countCritical;
|
||||
|
||||
/// Numero di categorie con obiettivo attivo (> 0)
|
||||
int get countTotalActive => categories.values
|
||||
.where((c) => c.hasTarget)
|
||||
.length;
|
||||
|
||||
/// Media giornaliera complessiva tenuta finora
|
||||
double get overallActualDailyRate =>
|
||||
elapsedWorkingDays > 0 ? (totalActualPieces / elapsedWorkingDays) : 0.0;
|
||||
|
||||
/// Media giornaliera complessiva necessaria per raggiungere Soglia 1
|
||||
double get overallRequiredDailyRateS1 {
|
||||
final remainingPieces =
|
||||
totalTargetS1 > totalActualPieces ? (totalTargetS1 - totalActualPieces) : 0;
|
||||
return remainingWorkingDays > 0 ? (remainingPieces / remainingWorkingDays) : 0.0;
|
||||
}
|
||||
|
||||
/// Media giornaliera complessiva necessaria per raggiungere Soglia 2
|
||||
double get overallRequiredDailyRateS2 {
|
||||
final remainingPieces =
|
||||
totalTargetS2 > totalActualPieces ? (totalTargetS2 - totalActualPieces) : 0;
|
||||
return remainingWorkingDays > 0 ? (remainingPieces / remainingWorkingDays) : 0.0;
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
targetId,
|
||||
storeId,
|
||||
staffId,
|
||||
staffName,
|
||||
totalWorkingDays,
|
||||
elapsedWorkingDays,
|
||||
remainingWorkingDays,
|
||||
categories,
|
||||
staffProgress,
|
||||
];
|
||||
}
|
||||
|
||||
/// Palette cromatica a 4 livelli (Verde, Verdino, Rosa, Rosso) per massima chiarezza visiva
|
||||
class PacingTheme {
|
||||
final Color primary;
|
||||
final Color background;
|
||||
final Color border;
|
||||
final Color text;
|
||||
final String label;
|
||||
final IconData icon;
|
||||
|
||||
const PacingTheme({
|
||||
required this.primary,
|
||||
required this.background,
|
||||
required this.border,
|
||||
required this.text,
|
||||
required this.label,
|
||||
required this.icon,
|
||||
});
|
||||
|
||||
static PacingTheme of(TargetPacingStatus status) {
|
||||
switch (status) {
|
||||
case TargetPacingStatus.inLineS2:
|
||||
return const PacingTheme(
|
||||
primary: Color(0xFF15803D), // Verde pieno (Sfidante centrato o in linea)
|
||||
background: Color(0xFFDCFCE7),
|
||||
border: Color(0xFF86EFAC),
|
||||
text: Color(0xFF14532D),
|
||||
label: 'In linea Sfidante',
|
||||
icon: Icons.rocket_launch_rounded,
|
||||
);
|
||||
case TargetPacingStatus.inLineS1:
|
||||
return const PacingTheme(
|
||||
primary: Color(0xFF0D9488), // Verdino / Mint (Minimo centrato o in linea)
|
||||
background: Color(0xFFCCFBF1),
|
||||
border: Color(0xFF5EEAD4),
|
||||
text: Color(0xFF115E59),
|
||||
label: 'In linea Minimo',
|
||||
icon: Icons.check_circle_outline_rounded,
|
||||
);
|
||||
case TargetPacingStatus.recoverable:
|
||||
return const PacingTheme(
|
||||
primary: Color(0xFFDB2777), // Rosa (Sotto ritmo ma recuperabile)
|
||||
background: Color(0xFFFCE7F3),
|
||||
border: Color(0xFFF9A8D4),
|
||||
text: Color(0xFF831843),
|
||||
label: 'Da spingere',
|
||||
icon: Icons.bolt_rounded,
|
||||
);
|
||||
case TargetPacingStatus.critical:
|
||||
return const PacingTheme(
|
||||
primary: Color(0xFFDC2626), // Rosso (Forte ritardo)
|
||||
background: Color(0xFFFEE2E2),
|
||||
border: Color(0xFFFCA5A5),
|
||||
text: Color(0xFF7F1D1D),
|
||||
label: 'In ritardo',
|
||||
icon: Icons.warning_amber_rounded,
|
||||
);
|
||||
case TargetPacingStatus.notSet:
|
||||
return const PacingTheme(
|
||||
primary: Colors.grey,
|
||||
background: Color(0xFFF3F4F6),
|
||||
border: Color(0xFFE5E7EB),
|
||||
text: Color(0xFF374151),
|
||||
label: 'Non impostato',
|
||||
icon: Icons.remove,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,836 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/core/routes/routes.dart';
|
||||
import 'package:flux/features/master_data/store/bloc/store_cubit.dart';
|
||||
import 'package:flux/features/targets/blocs/target_list_cubit.dart';
|
||||
import 'package:flux/features/targets/models/target_model.dart';
|
||||
import 'package:flux/features/targets/models/target_progress_model.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class TargetListScreen extends StatefulWidget {
|
||||
const TargetListScreen({super.key});
|
||||
|
||||
@override
|
||||
State<TargetListScreen> createState() => _TargetListScreenState();
|
||||
}
|
||||
|
||||
class _TargetListScreenState extends State<TargetListScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final currentStoreId =
|
||||
context.read<SessionCubit>().state.currentStore?.id;
|
||||
context.read<TargetListCubit>().loadTargets(storeId: currentStoreId);
|
||||
});
|
||||
}
|
||||
|
||||
String _formatMonthYear(DateTime date) {
|
||||
try {
|
||||
final formatter = DateFormat('MMMM yyyy', 'it_IT');
|
||||
final formatted = formatter.format(date);
|
||||
return formatted[0].toUpperCase() + formatted.substring(1);
|
||||
} catch (_) {
|
||||
final formatter = DateFormat('MM/yyyy');
|
||||
return formatter.format(date);
|
||||
}
|
||||
}
|
||||
|
||||
String _formatDateRange(DateTime start, DateTime end) {
|
||||
final formatter = DateFormat('dd/MM/yyyy');
|
||||
return '${formatter.format(start)} - ${formatter.format(end)}';
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final isDesktop = MediaQuery.sizeOf(context).width >= 900;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.colorScheme.surface,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
// ==========================================
|
||||
// HEADER
|
||||
// ==========================================
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: isDesktop ? 24.0 : 16.0,
|
||||
vertical: isDesktop ? 20.0 : 12.0,
|
||||
),
|
||||
color: theme.colorScheme.surface,
|
||||
child: _buildHeader(context, theme, isDesktop),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
|
||||
// ==========================================
|
||||
// LISTA DEI TARGET
|
||||
// ==========================================
|
||||
Expanded(
|
||||
child: BlocBuilder<TargetListCubit, TargetListState>(
|
||||
builder: (context, state) {
|
||||
if (state.status == TargetListStatus.loading &&
|
||||
state.targets.isEmpty) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
if (state.status == TargetListStatus.failure &&
|
||||
state.targets.isEmpty) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error_outline,
|
||||
size: 48,
|
||||
color: Colors.red,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
state.errorMessage ??
|
||||
'Errore nel caricamento dei target',
|
||||
style: const TextStyle(fontSize: 16),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
context.read<TargetListCubit>().loadTargets();
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
label: const Text('Riprova'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (state.targets.isEmpty) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(32.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(24),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.primary.withValues(
|
||||
alpha: 0.1,
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.track_changes_outlined,
|
||||
size: 64,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'Nessun target configurato',
|
||||
style: theme.textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'Definisci gli obiettivi mensili del negozio e assegnali agli addetti.',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
fontSize: 14,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
ElevatedButton.icon(
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text('Crea Primo Target'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 24,
|
||||
vertical: 12,
|
||||
),
|
||||
),
|
||||
onPressed: () => _goToNewTarget(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
await context.read<TargetListCubit>().loadTargets();
|
||||
},
|
||||
child: ListView.separated(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
itemCount: state.targets.length,
|
||||
separatorBuilder: (_, _) => const SizedBox(height: 16),
|
||||
itemBuilder: (context, index) {
|
||||
final target = state.targets[index];
|
||||
final progress = state.progressMap[target.id];
|
||||
return _buildTargetCard(
|
||||
context,
|
||||
target,
|
||||
theme,
|
||||
progress: progress,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildHeader(BuildContext context, ThemeData theme, bool isDesktop) {
|
||||
return BlocBuilder<TargetListCubit, TargetListState>(
|
||||
builder: (context, state) {
|
||||
final stores = context.watch<StoreCubit>().state.stores;
|
||||
|
||||
final titleWidget = Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.track_changes_outlined,
|
||||
color: theme.colorScheme.primary,
|
||||
size: isDesktop ? 28 : 24,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Obiettivi & Target',
|
||||
style: (isDesktop
|
||||
? theme.textTheme.headlineMedium
|
||||
: theme.textTheme.titleLarge)
|
||||
?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'Gestione e avanzamento delle quote mensili di vendita',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
fontSize: isDesktop ? 13 : 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
final storeFilterWidget = stores.length > 1
|
||||
? Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surfaceContainerHighest.withValues(alpha: 0.4),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: theme.dividerColor.withValues(alpha: 0.4),
|
||||
),
|
||||
),
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton<String?>(
|
||||
value: state.selectedStoreId,
|
||||
isDense: true,
|
||||
isExpanded: !isDesktop,
|
||||
hint: const Text('Tutti i negozi'),
|
||||
items: [
|
||||
const DropdownMenuItem<String?>(
|
||||
value: null,
|
||||
child: Text('Tutti i negozi'),
|
||||
),
|
||||
...stores.map((s) {
|
||||
return DropdownMenuItem<String?>(
|
||||
value: s.id,
|
||||
child: Text(
|
||||
s.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
onChanged: (val) {
|
||||
context.read<TargetListCubit>().filterByStore(val);
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
: null;
|
||||
|
||||
final newTargetButton = ElevatedButton.icon(
|
||||
icon: const Icon(Icons.add, size: 18),
|
||||
label: const Text('Nuovo Target'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: theme.colorScheme.primary,
|
||||
foregroundColor: theme.colorScheme.onPrimary,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: isDesktop ? 18 : 14,
|
||||
vertical: isDesktop ? 12 : 10,
|
||||
),
|
||||
),
|
||||
onPressed: () => _goToNewTarget(context),
|
||||
);
|
||||
|
||||
if (isDesktop) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(child: titleWidget),
|
||||
const SizedBox(width: 16),
|
||||
if (storeFilterWidget != null) ...[
|
||||
storeFilterWidget,
|
||||
const SizedBox(width: 12),
|
||||
],
|
||||
newTargetButton,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
// Su schermi mobili / stretti disponiamo su due livelli
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
titleWidget,
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
if (storeFilterWidget != null) ...[
|
||||
Expanded(child: storeFilterWidget),
|
||||
const SizedBox(width: 10),
|
||||
] else ...[
|
||||
const Spacer(),
|
||||
],
|
||||
newTargetButton,
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTargetCard(
|
||||
BuildContext context,
|
||||
TargetModel target,
|
||||
ThemeData theme, {
|
||||
TargetProgressModel? progress,
|
||||
}) {
|
||||
final title = _formatMonthYear(target.startDay);
|
||||
final range = _formatDateRange(target.startDay, target.endDay);
|
||||
final storeName = target.store?.name ?? 'Negozio';
|
||||
|
||||
final activeMetricsCount = target.metrics.activeMetricsCount;
|
||||
final staffCount = target.individualTargets.length;
|
||||
|
||||
return Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
side: BorderSide(color: theme.dividerColor.withValues(alpha: 0.6)),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: InkWell(
|
||||
onTap: () => _goToTargetDetail(context, target),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Riga 1: Titolo Mese + Badge Negozio + Azioni (Modifica / Elimina)
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.calendar_month_outlined,
|
||||
color: theme.colorScheme.primary,
|
||||
size: 26,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 8,
|
||||
runSpacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
Chip(
|
||||
label: Text(
|
||||
storeName,
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
backgroundColor: theme.colorScheme.primary
|
||||
.withValues(alpha: 0.1),
|
||||
side: BorderSide.none,
|
||||
padding: EdgeInsets.zero,
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
range,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
// Menu Azioni (Modifica / Elimina)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.edit_outlined),
|
||||
tooltip: 'Modifica quote target',
|
||||
onPressed: () => _goToEditTarget(context, target),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete_outline, color: Colors.red),
|
||||
tooltip: 'Elimina target',
|
||||
onPressed: () => _confirmDelete(context, target),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Divider(height: 1),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Riga 2: Stato Avanzamento Obiettivi (Presi, In Linea, Sotto)
|
||||
if (progress != null) ...[
|
||||
() {
|
||||
final greenTheme = PacingTheme.of(TargetPacingStatus.inLineS2);
|
||||
final verdinoTheme = PacingTheme.of(TargetPacingStatus.inLineS1);
|
||||
final pinkTheme = PacingTheme.of(TargetPacingStatus.recoverable);
|
||||
final redTheme = PacingTheme.of(TargetPacingStatus.critical);
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Sottotitolo informativo: Giorni Lavorativi ed Addetti
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.schedule_outlined,
|
||||
size: 15,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${progress.elapsedWorkingDays} gg trascorsi • ${progress.remainingWorkingDays} gg rimasti (escl. dom. e festivi) • $staffCount addetti',
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// I 3 INDICATORI CHIAVE: GIÀ PRESI, IN LINEA, SOTTO RITMO
|
||||
Wrap(
|
||||
spacing: 12,
|
||||
runSpacing: 10,
|
||||
children: [
|
||||
// 1. GIÀ PRESI (Verde)
|
||||
_buildPacingMetricCard(
|
||||
title: 'GIÀ PRESI',
|
||||
value: '${progress.countAchieved}',
|
||||
suffix: '/ ${progress.countTotalActive}',
|
||||
note: progress.countAchievedS2 > 0
|
||||
? '${progress.countAchievedS2} centrati in S2'
|
||||
: (progress.countAchieved > 0
|
||||
? 'Obiettivi raggiunti'
|
||||
: 'Nessuno ancora'),
|
||||
color: greenTheme.text,
|
||||
backgroundColor: greenTheme.background,
|
||||
borderColor: greenTheme.border,
|
||||
icon: Icons.emoji_events_rounded,
|
||||
),
|
||||
|
||||
// 2. IN LINEA (Verdino)
|
||||
_buildPacingMetricCard(
|
||||
title: 'IN LINEA',
|
||||
value: '${progress.countInLineOnly}',
|
||||
suffix: 'obiettivi',
|
||||
note: 'A ritmo per chiudere',
|
||||
color: verdinoTheme.text,
|
||||
backgroundColor: verdinoTheme.background,
|
||||
borderColor: verdinoTheme.border,
|
||||
icon: Icons.trending_up_rounded,
|
||||
),
|
||||
|
||||
// 3. SOTTO RITMO (Rosa o Rosso)
|
||||
_buildPacingMetricCard(
|
||||
title: 'SOTTO RITMO',
|
||||
value: '${progress.countBehind}',
|
||||
suffix: 'da spingere',
|
||||
note: progress.countBehind == 0
|
||||
? 'Tutto a ritmo!'
|
||||
: '${progress.countRecoverable} recuperabili • ${progress.countCritical} critici',
|
||||
color: progress.countBehind == 0
|
||||
? greenTheme.text
|
||||
: (progress.countCritical > 0
|
||||
? redTheme.text
|
||||
: pinkTheme.text),
|
||||
backgroundColor: progress.countBehind == 0
|
||||
? greenTheme.background
|
||||
: (progress.countCritical > 0
|
||||
? redTheme.background
|
||||
: pinkTheme.background),
|
||||
borderColor: progress.countBehind == 0
|
||||
? greenTheme.border
|
||||
: (progress.countCritical > 0
|
||||
? redTheme.border
|
||||
: pinkTheme.border),
|
||||
icon: progress.countBehind == 0
|
||||
? Icons.check_circle_rounded
|
||||
: (progress.countCritical > 0
|
||||
? Icons.warning_amber_rounded
|
||||
: Icons.bolt_rounded),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
|
||||
// Panoramica Categorie Attive con il loro rispettivo stato
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
...progress.categories.values
|
||||
.where((c) => c.hasTarget)
|
||||
.map((c) {
|
||||
if (c.isAchieved) {
|
||||
return _buildSmartChip(
|
||||
icon: Icons.emoji_events_rounded,
|
||||
label: '${c.label}: Preso! 🎉',
|
||||
color: greenTheme.text,
|
||||
backgroundColor: greenTheme.background,
|
||||
borderColor: greenTheme.border,
|
||||
);
|
||||
} else if (c.isInLineOnly) {
|
||||
return _buildSmartChip(
|
||||
icon: Icons.check_circle_outline_rounded,
|
||||
label: '${c.label}: In linea ✅',
|
||||
color: verdinoTheme.text,
|
||||
backgroundColor: verdinoTheme.background,
|
||||
borderColor: verdinoTheme.border,
|
||||
);
|
||||
} else if (c.isRecoverable) {
|
||||
return _buildSmartChip(
|
||||
icon: Icons.bolt_rounded,
|
||||
label: '${c.label}: Da spingere ⚡',
|
||||
color: pinkTheme.text,
|
||||
backgroundColor: pinkTheme.background,
|
||||
borderColor: pinkTheme.border,
|
||||
);
|
||||
} else {
|
||||
return _buildSmartChip(
|
||||
icon: Icons.warning_amber_rounded,
|
||||
label: '${c.label}: In ritardo 🔴',
|
||||
color: redTheme.text,
|
||||
backgroundColor: redTheme.background,
|
||||
borderColor: redTheme.border,
|
||||
);
|
||||
}
|
||||
}),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}(),
|
||||
] else ...[
|
||||
// Fallback indicatori di base se il progresso è ancora in caricamento
|
||||
Wrap(
|
||||
spacing: 12,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
_buildMetricBadge(
|
||||
label: 'Obiettivi Attivi',
|
||||
value: '$activeMetricsCount categorie',
|
||||
color: Colors.blue,
|
||||
icon: Icons.flag_outlined,
|
||||
),
|
||||
_buildMetricBadge(
|
||||
label: 'Addetti Coinvolti',
|
||||
value: '$staffCount assegnati',
|
||||
color: Colors.teal,
|
||||
icon: Icons.people_outline,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 14),
|
||||
|
||||
// Pulsante Visualizza Avanzamento
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: TextButton.icon(
|
||||
onPressed: () => _goToTargetDetail(context, target),
|
||||
icon: const Icon(Icons.analytics_outlined, size: 18),
|
||||
label: const Text('Vedi Avanzamento & Statistiche'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSmartChip({
|
||||
required IconData icon,
|
||||
required String label,
|
||||
required Color color,
|
||||
required Color backgroundColor,
|
||||
Color? borderColor,
|
||||
}) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: borderColor ?? color.withValues(alpha: 0.3),
|
||||
width: 1.2,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(icon, size: 14, color: color),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildPacingMetricCard({
|
||||
required String title,
|
||||
required String value,
|
||||
required String suffix,
|
||||
required String note,
|
||||
required Color color,
|
||||
required Color backgroundColor,
|
||||
required Color borderColor,
|
||||
IconData? icon,
|
||||
}) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: borderColor, width: 1.2),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (icon != null) ...[
|
||||
Icon(icon, size: 14, color: color.withValues(alpha: 0.9)),
|
||||
const SizedBox(width: 5),
|
||||
],
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: color.withValues(alpha: 0.9),
|
||||
letterSpacing: 0.5,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
children: [
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
suffix,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: color.withValues(alpha: 0.85),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
note,
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
color: color.withValues(alpha: 0.8),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMetricBadge({
|
||||
required String label,
|
||||
required String value,
|
||||
required Color color,
|
||||
required IconData icon,
|
||||
}) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withValues(alpha: 0.08),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: color.withValues(alpha: 0.25)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(icon, size: 16, color: color),
|
||||
const SizedBox(width: 8),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
color: Colors.grey.shade700,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _goToNewTarget(BuildContext context) {
|
||||
context.pushNamed(Routes.targetForm);
|
||||
}
|
||||
|
||||
void _goToEditTarget(BuildContext context, TargetModel target) {
|
||||
context.pushNamed(Routes.targetForm, extra: target);
|
||||
}
|
||||
|
||||
void _goToTargetDetail(BuildContext context, TargetModel target) {
|
||||
context.pushNamed(Routes.targetDetail, extra: target);
|
||||
}
|
||||
|
||||
Future<void> _confirmDelete(BuildContext context, TargetModel target) async {
|
||||
final title = _formatMonthYear(target.startDay);
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (dialogContext) {
|
||||
return AlertDialog(
|
||||
title: const Row(
|
||||
children: [
|
||||
Icon(Icons.warning_amber_rounded, color: Colors.red),
|
||||
SizedBox(width: 8),
|
||||
Text('Elimina Target'),
|
||||
],
|
||||
),
|
||||
content: Text(
|
||||
'Sei sicuro di voler eliminare il target di "$title"?\nVerranno eliminati anche tutti i target individuali assegnati agli addetti per questo mese.',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext, false),
|
||||
child: const Text('Annulla'),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
onPressed: () => Navigator.pop(dialogContext, true),
|
||||
child: const Text('Elimina'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (confirmed == true && context.mounted) {
|
||||
final success = await context.read<TargetListCubit>().deleteTarget(
|
||||
target.id!,
|
||||
);
|
||||
if (success && context.mounted) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(const SnackBar(content: Text('Target eliminato.')));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/features/tasks/data/task_repository.dart';
|
||||
@@ -27,12 +28,15 @@ class TaskListCubit extends Cubit<TaskListState> {
|
||||
_loadTasksSilently();
|
||||
|
||||
// Ci mettiamo in ascolto del campanello del Repository
|
||||
_taskSubscription = _repository.watchCompanyTasks(currentCompanyId).listen((
|
||||
_,
|
||||
) {
|
||||
// Quando il campanello suona (qualcosa è cambiato a DB), ricarichiamo!
|
||||
_loadTasksSilently();
|
||||
});
|
||||
_taskSubscription = _repository.watchCompanyTasks(currentCompanyId).listen(
|
||||
(_) {
|
||||
// Quando il campanello suona (qualcosa è cambiato a DB), ricarichiamo!
|
||||
_loadTasksSilently();
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
debugPrint('Task list stream error: $error');
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> loadTasks() async {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/features/tickets/models/ticket_model.dart';
|
||||
@@ -13,8 +14,19 @@ class TicketListCubit extends Cubit<TicketListState> {
|
||||
.get<TrackingRepository>();
|
||||
static const int _limit = 20; // Paginazione a blocchi di 20
|
||||
|
||||
StreamSubscription<void>? _ticketsSubscription;
|
||||
|
||||
TicketListCubit() : super(const TicketListState()) {
|
||||
loadTickets(refresh: true);
|
||||
_ticketsSubscription = _repository.onTicketsChanged.listen((_) {
|
||||
loadTickets(refresh: true);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() {
|
||||
_ticketsSubscription?.cancel();
|
||||
return super.close();
|
||||
}
|
||||
|
||||
int _fetchId = 0;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/core/enums_and_consts/consts.dart';
|
||||
@@ -16,6 +17,17 @@ class TicketRepository {
|
||||
|
||||
static const String _tableName = Tables.tickets;
|
||||
|
||||
final StreamController<void> _ticketsChangedController =
|
||||
StreamController<void>.broadcast();
|
||||
|
||||
Stream<void> get onTicketsChanged => _ticketsChangedController.stream;
|
||||
|
||||
void notifyTicketsChanged() {
|
||||
if (!_ticketsChangedController.isClosed) {
|
||||
_ticketsChangedController.add(null);
|
||||
}
|
||||
}
|
||||
|
||||
// --- RECUPERO PAGINATO CON FILTRI E JOIN DEI TICKET DI UNO STORE ---
|
||||
Future<List<TicketModel>> fetchStoreTickets({
|
||||
required int offset,
|
||||
@@ -280,6 +292,7 @@ class TicketRepository {
|
||||
.select()
|
||||
.single();
|
||||
|
||||
notifyTicketsChanged();
|
||||
return TicketModel.fromMap(response);
|
||||
} catch (e) {
|
||||
throw Exception('Errore nella creazione del ticket: $e');
|
||||
@@ -300,6 +313,7 @@ class TicketRepository {
|
||||
.select()
|
||||
.single();
|
||||
|
||||
notifyTicketsChanged();
|
||||
return TicketModel.fromMap(response);
|
||||
} catch (e) {
|
||||
throw Exception('Errore nell\'aggiornamento del ticket: $e');
|
||||
@@ -313,6 +327,7 @@ class TicketRepository {
|
||||
.from(_tableName)
|
||||
.update({'ticket_status': TicketStatus.closed.value})
|
||||
.inFilter('id', ticketIds);
|
||||
notifyTicketsChanged();
|
||||
} catch (e) {
|
||||
throw Exception('Errore nella chiusura dei ticket: $e');
|
||||
}
|
||||
@@ -322,6 +337,7 @@ class TicketRepository {
|
||||
Future<void> deleteTicket(String ticketId) async {
|
||||
try {
|
||||
await _supabase.from(_tableName).delete().eq('id', ticketId);
|
||||
notifyTicketsChanged();
|
||||
} catch (e) {
|
||||
throw Exception('Errore nell\'eliminazione del ticket: $e');
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/core/routes/routes.dart';
|
||||
import 'package:flux/core/widgets/shared_forms/attachments_section.dart';
|
||||
import 'package:flux/core/widgets/shared_forms/customer_section.dart';
|
||||
import 'package:flux/core/widgets/shared_forms/model_section.dart';
|
||||
import 'package:flux/core/widgets/shared_forms/shared_files_section.dart';
|
||||
import 'package:flux/core/widgets/staff_selector_modal.dart';
|
||||
import 'package:flux/features/attachments/blocs/attachments_bloc.dart';
|
||||
import 'package:flux/features/company/models/company_model.dart';
|
||||
@@ -349,27 +349,31 @@ class _TicketFormScreenState extends State<TicketFormScreen> {
|
||||
}
|
||||
|
||||
void _deleteTicket(TicketModel ticket, {Color color = Colors.red}) {
|
||||
final ticketFormCubit = context.read<TicketFormCubit>();
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('Conferma Cancellazione'),
|
||||
content: Text(
|
||||
'Sei sicuro di voler cancellare il ticket "${ticket.referenceId}"? Questa azione è irreversibile.',
|
||||
builder: (dialogContext) => BlocProvider.value(
|
||||
value: ticketFormCubit,
|
||||
child: AlertDialog(
|
||||
title: const Text('Conferma Cancellazione'),
|
||||
content: Text(
|
||||
'Sei sicuro di voler cancellare il ticket "${ticket.referenceId}"? Questa azione è irreversibile.',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(dialogContext).pop(),
|
||||
child: const Text('Annulla'),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: color),
|
||||
onPressed: () {
|
||||
ticketFormCubit.deleteTicket();
|
||||
Navigator.of(dialogContext).pop(); // Chiude il dialog
|
||||
},
|
||||
child: const Text('Cancella Ticket'),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text('Annulla'),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: color),
|
||||
onPressed: () {
|
||||
context.read<TicketFormCubit>().deleteTicket();
|
||||
Navigator.of(context).pop(); // Chiude il dialog
|
||||
},
|
||||
child: const Text('Cancella Ticket'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -385,6 +389,15 @@ class _TicketFormScreenState extends State<TicketFormScreen> {
|
||||
_syncTextControllers(state.ticket);
|
||||
}
|
||||
|
||||
if (state.ticket.id != null && state.ticket.id!.isNotEmpty) {
|
||||
final attachmentsBloc = context.read<AttachmentsBloc>();
|
||||
if (attachmentsBloc.state.parentId != state.ticket.id) {
|
||||
attachmentsBloc.add(
|
||||
ParentEntitySavedEvent(state.ticket.id!),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (state.status == TicketFormStatus.deleted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
@@ -1047,15 +1060,12 @@ class _TicketFormScreenState extends State<TicketFormScreen> {
|
||||
.updateFields(assignedToId: staff.id, assignedToName: staff.name),
|
||||
),
|
||||
const Divider(height: 32),
|
||||
// ECCO LA MAGIA:
|
||||
SharedFilesSection(
|
||||
titleNameForUpload: ticket.customer?.name ?? 'Nuovo Ticket',
|
||||
onGenerateIdForQr: _generateIdForQr,
|
||||
),
|
||||
/* SharedAttachmentsSection(
|
||||
SharedAttachmentsSection(
|
||||
parentType: AttachmentParentType.ticket,
|
||||
parentId: ticket.id,
|
||||
), */
|
||||
titleForUpload: ticket.customer?.name ?? 'Nuovo Ticket',
|
||||
onEnsureEntitySaved: _generateIdForQr,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -26,22 +26,32 @@ class TicketListCard extends StatelessWidget {
|
||||
void _openFile({
|
||||
required BuildContext context,
|
||||
required AttachmentModel file,
|
||||
List<AttachmentModel>? attachments,
|
||||
int? initialIndex,
|
||||
}) {
|
||||
// 1. Catturiamo il BLoC dalla pagina corrente prima di navigare
|
||||
final operationFilesBloc = context.read<AttachmentsBloc>();
|
||||
final list = attachments ?? [file];
|
||||
final index = initialIndex ?? (list.isNotEmpty ? list.indexOf(file) : 0);
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (viewerContext) => BlocProvider.value(
|
||||
value: operationFilesBloc,
|
||||
child: AttachmentViewerScreen(
|
||||
attachment: file,
|
||||
onRename: (newName) {
|
||||
attachments: list,
|
||||
initialIndex: index >= 0 ? index : 0,
|
||||
onRenameAttachment: (targetFile, newName) {
|
||||
// Spara l'evento al BLoC e lui farà il resto!
|
||||
operationFilesBloc.add(RenameAttachmentEvent(file, newName));
|
||||
operationFilesBloc.add(
|
||||
RenameAttachmentEvent(targetFile, newName),
|
||||
);
|
||||
},
|
||||
onDelete: () {
|
||||
operationFilesBloc.add(DeleteSpecificAttachmentEvent(file));
|
||||
onDeleteAttachment: (targetFile) {
|
||||
operationFilesBloc.add(
|
||||
DeleteSpecificAttachmentEvent(targetFile),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -155,6 +165,8 @@ class TicketListCard extends StatelessWidget {
|
||||
_openFile(
|
||||
context: context,
|
||||
file: attachments.first,
|
||||
attachments: attachments,
|
||||
initialIndex: 0,
|
||||
);
|
||||
} else {
|
||||
// CASO 2: Più allegati. Mostriamo una BottomSheet fulminea per far scegliere all'utente.
|
||||
@@ -188,6 +200,8 @@ class TicketListCard extends StatelessWidget {
|
||||
_openFile(
|
||||
context: context,
|
||||
file: file,
|
||||
attachments: attachments,
|
||||
initialIndex: index,
|
||||
); // Apre il viewer
|
||||
},
|
||||
);
|
||||
|
||||
+236
-32
@@ -32,10 +32,23 @@ import 'package:flux/features/master_data/store/bloc/store_cubit.dart';
|
||||
import 'package:flutter_web_plugins/url_strategy.dart';
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:flux/core/utils/auto_update_service.dart';
|
||||
|
||||
String? initialRecoveryFragment;
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// Scudo di Sicurezza Globale: Previene crash dell'app per eccezioni asincrone di rete/WebSocket non gestite
|
||||
FlutterError.onError = (FlutterErrorDetails details) {
|
||||
FlutterError.presentError(details);
|
||||
debugPrint('FlutterError caught: ${details.exception}');
|
||||
};
|
||||
|
||||
PlatformDispatcher.instance.onError = (Object error, StackTrace stack) {
|
||||
debugPrint('PlatformDispatcher error caught: $error');
|
||||
return true; // Contrassegna l'errore come gestito ed evita il crash dell'app
|
||||
};
|
||||
|
||||
await dotenv.load(fileName: ".env");
|
||||
await init();
|
||||
final initialUri = Uri.base;
|
||||
@@ -236,9 +249,14 @@ class GlobalUpdateChecker extends StatefulWidget {
|
||||
|
||||
class _GlobalUpdateCheckerState extends State<GlobalUpdateChecker>
|
||||
with WidgetsBindingObserver {
|
||||
bool _mustUpdate = false;
|
||||
String? _updateUrl;
|
||||
UpdateInfo? _updateInfo;
|
||||
bool _isDismissed = false;
|
||||
String? _dismissedVersion;
|
||||
StreamSubscription? _versionSubscription;
|
||||
bool _isUpdating = false;
|
||||
double _downloadProgress = 0.0;
|
||||
String _statusMessage = "";
|
||||
String? _errorMessage;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -280,11 +298,16 @@ class _GlobalUpdateCheckerState extends State<GlobalUpdateChecker>
|
||||
|
||||
// Riapriamo il rubinetto di Supabase
|
||||
_versionSubscription = GetIt.I<SupabaseClient>()
|
||||
.from('app_config') // <-- Sostituisci col nome reale della tua tabella
|
||||
.from('app_config')
|
||||
.stream(primaryKey: ['id'])
|
||||
.listen((_) {
|
||||
_checkVersion();
|
||||
});
|
||||
.listen(
|
||||
(_) {
|
||||
_checkVersion();
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
debugPrint('Realtime version check stream error: $error');
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _stopRealtimeVersionCheck() {
|
||||
@@ -294,19 +317,63 @@ class _GlobalUpdateCheckerState extends State<GlobalUpdateChecker>
|
||||
}
|
||||
|
||||
Future<void> _checkVersion() async {
|
||||
final updateUrl = await VersionCheckService().checkForceUpdate();
|
||||
final updateInfo = await VersionCheckService().checkUpdate();
|
||||
|
||||
if (updateUrl != null && mounted) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_mustUpdate = true;
|
||||
_updateUrl = updateUrl;
|
||||
_updateInfo = updateInfo;
|
||||
// Se arriva una versione diversa da quella già rimandata, azzeriamo il dismiss
|
||||
if (updateInfo != null &&
|
||||
updateInfo.latestVersion != _dismissedVersion) {
|
||||
_isDismissed = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _startAutoUpdate() async {
|
||||
final updateUrl = _updateInfo?.downloadUrl;
|
||||
if (updateUrl == null || updateUrl.isEmpty) return;
|
||||
|
||||
setState(() {
|
||||
_isUpdating = true;
|
||||
_errorMessage = null;
|
||||
_downloadProgress = 0.0;
|
||||
_statusMessage = "Avvio aggiornamento in corso...";
|
||||
});
|
||||
|
||||
try {
|
||||
await AutoUpdateService.downloadAndApplyUpdate(
|
||||
downloadUrl: updateUrl,
|
||||
onProgress: (progress, status) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_downloadProgress = progress;
|
||||
_statusMessage = status;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isUpdating = false;
|
||||
_errorMessage = "Errore durante l'aggiornamento automatico: $e";
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!_mustUpdate) return widget.child;
|
||||
final updateInfo = _updateInfo;
|
||||
final showOverlay = updateInfo != null &&
|
||||
updateInfo.hasUpdate &&
|
||||
(updateInfo.isMandatory || !_isDismissed);
|
||||
|
||||
if (!showOverlay) return widget.child;
|
||||
|
||||
final isMandatory = updateInfo.isMandatory;
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
@@ -320,7 +387,7 @@ class _GlobalUpdateCheckerState extends State<GlobalUpdateChecker>
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(24),
|
||||
padding: const EdgeInsets.all(24),
|
||||
constraints: const BoxConstraints(maxWidth: 400),
|
||||
constraints: const BoxConstraints(maxWidth: 440),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
@@ -339,32 +406,96 @@ class _GlobalUpdateCheckerState extends State<GlobalUpdateChecker>
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
kIsWeb ? Icons.cached : Icons.system_update,
|
||||
color: Colors.orange,
|
||||
isMandatory
|
||||
? Icons.warning_amber_rounded
|
||||
: (kIsWeb ? Icons.cached : Icons.system_update),
|
||||
color:
|
||||
isMandatory ? Colors.amber[700] : Colors.blue,
|
||||
size: 32,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Flexible(
|
||||
Expanded(
|
||||
child: Text(
|
||||
kIsWeb
|
||||
? "Aggiornamento"
|
||||
: "Aggiornamento Obbligatorio",
|
||||
style: Theme.of(context).textTheme.titleLarge
|
||||
isMandatory
|
||||
? "Aggiornamento Obbligatorio"
|
||||
: (kIsWeb
|
||||
? "Aggiornamento Disponibile"
|
||||
: "Nuova Versione Disponibile"),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleLarge
|
||||
?.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
if (!isMandatory && !_isUpdating)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
tooltip: "Chiudi e rimanda",
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_isDismissed = true;
|
||||
_dismissedVersion =
|
||||
updateInfo.latestVersion;
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
kIsWeb
|
||||
? "È stata rilasciata una nuova versione dell'applicazione. Ricarica la pagina per scaricare il nuovo codice."
|
||||
: "Per continuare ad utilizzare l'applicazione è necessario scaricare e installare l'ultimo aggiornamento.",
|
||||
? "È stata rilasciata una nuova versione dell'applicazione (${updateInfo.latestVersion}). Ricarica la pagina per scaricare il nuovo codice."
|
||||
: (isMandatory
|
||||
? "La versione attuale non è più supportata (minima richiesta: ${updateInfo.minVersion}). È necessario aggiornare all'ultima versione (${updateInfo.latestVersion}) per continuare a lavorare."
|
||||
: "È disponibile la nuova versione ${updateInfo.latestVersion}. Puoi aggiornare subito oppure rimandare."),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 16),
|
||||
style: const TextStyle(fontSize: 15),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
if (kIsWeb)
|
||||
if (_errorMessage != null) ...[
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
color: Colors.red.withValues(alpha: 0.3),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
_errorMessage!,
|
||||
style: const TextStyle(
|
||||
color: Colors.red,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
if (_isUpdating) ...[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: LinearProgressIndicator(
|
||||
value: _downloadProgress > 0
|
||||
? _downloadProgress
|
||||
: null,
|
||||
minHeight: 10,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
_statusMessage,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withValues(alpha: 0.7),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
] else if (kIsWeb) ...[
|
||||
FilledButton.icon(
|
||||
icon: const Icon(Icons.refresh),
|
||||
label: const Text("RICARICA ORA"),
|
||||
@@ -375,8 +506,50 @@ class _GlobalUpdateCheckerState extends State<GlobalUpdateChecker>
|
||||
// Hard reload aggirando la cache!
|
||||
html.window.location.reload();
|
||||
},
|
||||
)
|
||||
else
|
||||
),
|
||||
if (!isMandatory) ...[
|
||||
const SizedBox(height: 10),
|
||||
OutlinedButton(
|
||||
style: OutlinedButton.styleFrom(
|
||||
minimumSize: const Size(double.infinity, 44),
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_isDismissed = true;
|
||||
_dismissedVersion =
|
||||
updateInfo.latestVersion;
|
||||
});
|
||||
},
|
||||
child: const Text("PIÙ TARDI"),
|
||||
),
|
||||
],
|
||||
] else if (AutoUpdateService.isAutoUpdateSupported) ...[
|
||||
FilledButton.icon(
|
||||
icon: const Icon(Icons.system_update_alt),
|
||||
label: const Text("AGGIORNA ORA"),
|
||||
style: FilledButton.styleFrom(
|
||||
minimumSize: const Size(double.infinity, 50),
|
||||
backgroundColor: Colors.blue,
|
||||
),
|
||||
onPressed: _startAutoUpdate,
|
||||
),
|
||||
if (!isMandatory) ...[
|
||||
const SizedBox(height: 10),
|
||||
OutlinedButton(
|
||||
style: OutlinedButton.styleFrom(
|
||||
minimumSize: const Size(double.infinity, 44),
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_isDismissed = true;
|
||||
_dismissedVersion =
|
||||
updateInfo.latestVersion;
|
||||
});
|
||||
},
|
||||
child: const Text("PIÙ TARDI"),
|
||||
),
|
||||
],
|
||||
] else ...[
|
||||
FilledButton.icon(
|
||||
icon: const Icon(Icons.download),
|
||||
label: const Text("SCARICA AGGIORNAMENTO"),
|
||||
@@ -385,15 +558,46 @@ class _GlobalUpdateCheckerState extends State<GlobalUpdateChecker>
|
||||
backgroundColor: Colors.blue,
|
||||
),
|
||||
onPressed: () async {
|
||||
if (_updateUrl != null) {
|
||||
final url = Uri.parse(_updateUrl!);
|
||||
await launchUrl(
|
||||
url,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
}
|
||||
final url = Uri.parse(updateInfo.downloadUrl);
|
||||
await launchUrl(
|
||||
url,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
),
|
||||
if (!isMandatory) ...[
|
||||
const SizedBox(height: 10),
|
||||
OutlinedButton(
|
||||
style: OutlinedButton.styleFrom(
|
||||
minimumSize: const Size(double.infinity, 44),
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_isDismissed = true;
|
||||
_dismissedVersion =
|
||||
updateInfo.latestVersion;
|
||||
});
|
||||
},
|
||||
child: const Text("PIÙ TARDI"),
|
||||
),
|
||||
],
|
||||
],
|
||||
if (!_isUpdating &&
|
||||
AutoUpdateService.isAutoUpdateSupported &&
|
||||
_errorMessage != null) ...[
|
||||
const SizedBox(height: 10),
|
||||
TextButton.icon(
|
||||
icon: const Icon(Icons.open_in_browser, size: 16),
|
||||
label: const Text("Scarica manualmente dal browser"),
|
||||
onPressed: () async {
|
||||
final url = Uri.parse(updateInfo.downloadUrl);
|
||||
await launchUrl(
|
||||
url,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -27,6 +27,9 @@ import 'package:flux/features/tasks/data/task_repository.dart';
|
||||
import 'package:flux/features/tickets/blocs/ticket_list_cubit.dart';
|
||||
import 'package:flux/features/tickets/data/ticket_repository.dart';
|
||||
import 'package:flux/features/tickets/data/tickets_shipping_repository.dart';
|
||||
import 'package:flux/features/targets/data/targets_repository.dart';
|
||||
import 'package:flux/features/targets/data/target_progress_service.dart';
|
||||
import 'package:flux/features/targets/blocs/target_list_cubit.dart';
|
||||
import 'package:flux/features/tracking/blocs/tracking_cubit.dart';
|
||||
import 'package:flux/features/tracking/data/tracking_repository.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
@@ -69,6 +72,10 @@ Future<void> init() async {
|
||||
sl.registerLazySingleton<DocumentSequenceRepository>(
|
||||
() => DocumentSequenceRepository(),
|
||||
);
|
||||
sl.registerLazySingleton<TargetsRepository>(() => TargetsRepository());
|
||||
sl.registerLazySingleton<TargetProgressService>(
|
||||
() => TargetProgressService(),
|
||||
);
|
||||
|
||||
//Cubit globali
|
||||
sl.registerLazySingleton<SessionCubit>(
|
||||
@@ -88,4 +95,5 @@ Future<void> init() async {
|
||||
sl.registerFactory<TicketListCubit>(() => TicketListCubit());
|
||||
sl.registerFactory<TrackingCubit>(() => TrackingCubit());
|
||||
sl.registerFactory<NotesCubit>(() => NotesCubit());
|
||||
sl.registerFactory<TargetListCubit>(() => TargetListCubit());
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import file_selector_macos
|
||||
import firebase_core
|
||||
import firebase_messaging
|
||||
import package_info_plus
|
||||
import path_provider_foundation
|
||||
import pdfx
|
||||
import printing
|
||||
import shared_preferences_foundation
|
||||
@@ -23,6 +24,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
|
||||
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
|
||||
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
PdfxPlugin.register(with: registry.registrar(forPlugin: "PdfxPlugin"))
|
||||
PrintingPlugin.register(with: registry.registrar(forPlugin: "PrintingPlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
platform :osx, '10.15'
|
||||
platform :osx, '12.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
||||
+46
-38
@@ -5,33 +5,33 @@ PODS:
|
||||
- FlutterMacOS
|
||||
- file_selector_macos (0.0.1):
|
||||
- FlutterMacOS
|
||||
- Firebase/CoreOnly (12.15.0):
|
||||
- FirebaseCore (~> 12.15.0)
|
||||
- Firebase/Messaging (12.15.0):
|
||||
- Firebase/CoreOnly (12.19.0):
|
||||
- FirebaseCore (~> 12.19.0)
|
||||
- Firebase/Messaging (12.19.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseMessaging (~> 12.15.0)
|
||||
- firebase_core (4.11.0):
|
||||
- Firebase/CoreOnly (~> 12.15.0)
|
||||
- FirebaseMessaging (~> 12.19.0)
|
||||
- firebase_core (4.15.0):
|
||||
- Firebase/CoreOnly (~> 12.19.0)
|
||||
- FlutterMacOS
|
||||
- firebase_messaging (16.4.1):
|
||||
- Firebase/CoreOnly (~> 12.15.0)
|
||||
- Firebase/Messaging (~> 12.15.0)
|
||||
- firebase_messaging (16.7.0):
|
||||
- Firebase/CoreOnly (~> 12.19.0)
|
||||
- Firebase/Messaging (~> 12.19.0)
|
||||
- firebase_core
|
||||
- FlutterMacOS
|
||||
- FirebaseCore (12.15.0):
|
||||
- FirebaseCoreInternal (~> 12.15.0)
|
||||
- FirebaseCore (12.19.0):
|
||||
- FirebaseCoreInternal (~> 12.19.0)
|
||||
- GoogleUtilities/Environment (~> 8.1)
|
||||
- GoogleUtilities/Logger (~> 8.1)
|
||||
- FirebaseCoreInternal (12.15.0):
|
||||
- FirebaseCoreInternal (12.19.0):
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.1)"
|
||||
- FirebaseInstallations (12.15.0):
|
||||
- FirebaseCore (~> 12.15.0)
|
||||
- FirebaseInstallations (12.19.0):
|
||||
- FirebaseCore (~> 12.19.0)
|
||||
- GoogleUtilities/Environment (~> 8.1)
|
||||
- GoogleUtilities/UserDefaults (~> 8.1)
|
||||
- PromisesObjC (~> 2.4)
|
||||
- FirebaseMessaging (12.15.0):
|
||||
- FirebaseCore (~> 12.15.0)
|
||||
- FirebaseInstallations (~> 12.15.0)
|
||||
- FirebaseMessaging (12.19.0):
|
||||
- FirebaseCore (~> 12.19.0)
|
||||
- FirebaseInstallations (~> 12.19.0)
|
||||
- GoogleDataTransport (~> 10.1)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
|
||||
- GoogleUtilities/Environment (~> 8.1)
|
||||
@@ -42,28 +42,28 @@ PODS:
|
||||
- GoogleDataTransport (10.1.1):
|
||||
- nanopb (~> 3.30910.0)
|
||||
- PromisesObjC (~> 2.4)
|
||||
- GoogleUtilities/AppDelegateSwizzler (8.1.2):
|
||||
- GoogleUtilities/AppDelegateSwizzler (8.1.4):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Environment (8.1.2):
|
||||
- GoogleUtilities/Environment (8.1.4):
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Logger (8.1.2):
|
||||
- GoogleUtilities/Logger (8.1.4):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Network (8.1.2):
|
||||
- GoogleUtilities/Network (8.1.4):
|
||||
- GoogleUtilities/Logger
|
||||
- "GoogleUtilities/NSData+zlib"
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Reachability
|
||||
- "GoogleUtilities/NSData+zlib (8.1.2)":
|
||||
- "GoogleUtilities/NSData+zlib (8.1.4)":
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Privacy (8.1.2)
|
||||
- GoogleUtilities/Reachability (8.1.2):
|
||||
- GoogleUtilities/Privacy (8.1.4)
|
||||
- GoogleUtilities/Reachability (8.1.4):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/UserDefaults (8.1.2):
|
||||
- GoogleUtilities/UserDefaults (8.1.4):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Privacy
|
||||
- nanopb (3.30910.0):
|
||||
@@ -73,7 +73,11 @@ PODS:
|
||||
- nanopb/encode (3.30910.0)
|
||||
- package_info_plus (0.0.1):
|
||||
- FlutterMacOS
|
||||
- path_provider_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- pdfx (1.0.0):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- printing (1.0.0):
|
||||
- FlutterMacOS
|
||||
@@ -92,7 +96,8 @@ DEPENDENCIES:
|
||||
- firebase_messaging (from `Flutter/ephemeral/.symlinks/plugins/firebase_messaging/macos`)
|
||||
- FlutterMacOS (from `Flutter/ephemeral`)
|
||||
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
|
||||
- pdfx (from `Flutter/ephemeral/.symlinks/plugins/pdfx/macos`)
|
||||
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- pdfx (from `Flutter/ephemeral/.symlinks/plugins/pdfx/darwin`)
|
||||
- printing (from `Flutter/ephemeral/.symlinks/plugins/printing/macos`)
|
||||
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||
@@ -124,8 +129,10 @@ EXTERNAL SOURCES:
|
||||
:path: Flutter/ephemeral
|
||||
package_info_plus:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
|
||||
path_provider_foundation:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
|
||||
pdfx:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/pdfx/macos
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/pdfx/darwin
|
||||
printing:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/printing/macos
|
||||
shared_preferences_foundation:
|
||||
@@ -137,24 +144,25 @@ SPEC CHECKSUMS:
|
||||
app_links: 05a6ec2341985eb05e9f97dc63f5837c39895c3f
|
||||
file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a
|
||||
file_selector_macos: 9e9e068e90ebee155097d00e89ae91edb2374db7
|
||||
Firebase: a8539b633d474fbeb654c7043f9c1649e274045b
|
||||
firebase_core: 4922bf7ac16c97fb67008a1a00842059b345b0d9
|
||||
firebase_messaging: 6c506190a7499e67e644957961f86efe1ac1c3e3
|
||||
FirebaseCore: 2e86a4ea1684d4381707069e4a6d89ac808e901e
|
||||
FirebaseCoreInternal: 6ab6a02c94446c026d2cf35cf5383842ebaa4992
|
||||
FirebaseInstallations: eb29ccbf64eaedf86fd5b2ccc7fabde567660b52
|
||||
FirebaseMessaging: 40017d7bc8457ee295b0f41d480a80fdabc9994e
|
||||
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
|
||||
Firebase: 7ca191e43724142f79fae653547b3382c45413cc
|
||||
firebase_core: 43e1937898a25c5d76bc3ac4e58539465c9f219d
|
||||
firebase_messaging: cf6920ca401d6870c1095a15cec1d4b9ca92b89f
|
||||
FirebaseCore: c990214798d7c568ad436a15ba7da25c7a278c9a
|
||||
FirebaseCoreInternal: 656b1c2fd5a1c5976183dc54b73deda78fb26ee3
|
||||
FirebaseInstallations: f70a49eed611f5602f373e40974b3b01556ac217
|
||||
FirebaseMessaging: c15f48126adbe8b4d3238a5e1fa24bab3ad3e472
|
||||
FlutterMacOS: c232990155153907050900a2e175c7773903ba4e
|
||||
GoogleDataTransport: a24e58982ab3ba2f64d79613e027fe7f57e88539
|
||||
GoogleUtilities: 766ace00c6b10d8148408f329d10c4f051931850
|
||||
GoogleUtilities: db34c1c11c6f2eccb6fab2340cb8ceb1451299dc
|
||||
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
|
||||
package_info_plus: f0052d280d17aa382b932f399edf32507174e870
|
||||
pdfx: 1e79f57f7a6ce2f4a4c30f21fa54d3dc82441b51
|
||||
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
|
||||
pdfx: 824a9108791a81e400da7d1a903ab73668365072
|
||||
printing: 7916ffaaede65713863e621de9a4742d9fa723b9
|
||||
PromisesObjC: 752c3227f599e3467650e47ea36f433eeb10c273
|
||||
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
|
||||
url_launcher_macos: f87a979182d112f911de6820aefddaf56ee9fbfd
|
||||
|
||||
PODFILE CHECKSUM: 180da7a1dbc1d932db021ebc8007656e7c46dd99
|
||||
PODFILE CHECKSUM: 1920c73e89a474dd2aac51211a579ac3e392c7fa
|
||||
|
||||
COCOAPODS: 1.17.0
|
||||
@@ -589,7 +589,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
@@ -671,7 +671,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
@@ -721,7 +721,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
f4084dd344cf1045484c82f883b6ac45
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"appPreferencesBuildSettings":{},"buildConfigurations":[{"buildSettings":{"ALWAYS_SEARCH_USER_PATHS":"NO","CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED":"YES","CLANG_ANALYZER_NONNULL":"YES","CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION":"YES_AGGRESSIVE","CLANG_CXX_LANGUAGE_STANDARD":"gnu++14","CLANG_CXX_LIBRARY":"libc++","CLANG_ENABLE_MODULES":"YES","CLANG_ENABLE_OBJC_ARC":"YES","CLANG_ENABLE_OBJC_WEAK":"YES","CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING":"YES","CLANG_WARN_BOOL_CONVERSION":"YES","CLANG_WARN_COMMA":"YES","CLANG_WARN_CONSTANT_CONVERSION":"YES","CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS":"YES","CLANG_WARN_DIRECT_OBJC_ISA_USAGE":"YES_ERROR","CLANG_WARN_DOCUMENTATION_COMMENTS":"YES","CLANG_WARN_EMPTY_BODY":"YES","CLANG_WARN_ENUM_CONVERSION":"YES","CLANG_WARN_INFINITE_RECURSION":"YES","CLANG_WARN_INT_CONVERSION":"YES","CLANG_WARN_NON_LITERAL_NULL_CONVERSION":"YES","CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF":"YES","CLANG_WARN_OBJC_LITERAL_CONVERSION":"YES","CLANG_WARN_OBJC_ROOT_CLASS":"YES_ERROR","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"YES","CLANG_WARN_RANGE_LOOP_ANALYSIS":"YES","CLANG_WARN_STRICT_PROTOTYPES":"YES","CLANG_WARN_SUSPICIOUS_MOVE":"YES","CLANG_WARN_UNGUARDED_AVAILABILITY":"YES_AGGRESSIVE","CLANG_WARN_UNREACHABLE_CODE":"YES","CLANG_WARN__DUPLICATE_METHOD_MATCH":"YES","COPY_PHASE_STRIP":"NO","DEBUG_INFORMATION_FORMAT":"dwarf","ENABLE_STRICT_OBJC_MSGSEND":"YES","ENABLE_TESTABILITY":"YES","GCC_C_LANGUAGE_STANDARD":"gnu11","GCC_DYNAMIC_NO_PIC":"NO","GCC_NO_COMMON_BLOCKS":"YES","GCC_OPTIMIZATION_LEVEL":"0","GCC_PREPROCESSOR_DEFINITIONS":"POD_CONFIGURATION_DEBUG=1 DEBUG=1 $(inherited)","GCC_WARN_64_TO_32_BIT_CONVERSION":"YES","GCC_WARN_ABOUT_RETURN_TYPE":"YES_ERROR","GCC_WARN_UNDECLARED_SELECTOR":"YES","GCC_WARN_UNINITIALIZED_AUTOS":"YES_AGGRESSIVE","GCC_WARN_UNUSED_FUNCTION":"YES","GCC_WARN_UNUSED_VARIABLE":"YES","IPHONEOS_DEPLOYMENT_TARGET":"13.0","MTL_ENABLE_DEBUG_INFO":"INCLUDE_SOURCE","MTL_FAST_MATH":"YES","ONLY_ACTIVE_ARCH":"YES","PRODUCT_NAME":"$(TARGET_NAME)","STRIP_INSTALLED_PRODUCT":"NO","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"DEBUG","SWIFT_OPTIMIZATION_LEVEL":"-Onone","SWIFT_VERSION":"5.0","SYMROOT":"${SRCROOT}/../build"},"guid":"bfdfe7dc352907fc980b868725387e983f8723597279233a8f05ceff9fe3456f","name":"Debug"},{"buildSettings":{"ALWAYS_SEARCH_USER_PATHS":"NO","CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED":"YES","CLANG_ANALYZER_NONNULL":"YES","CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION":"YES_AGGRESSIVE","CLANG_CXX_LANGUAGE_STANDARD":"gnu++14","CLANG_CXX_LIBRARY":"libc++","CLANG_ENABLE_MODULES":"YES","CLANG_ENABLE_OBJC_ARC":"YES","CLANG_ENABLE_OBJC_WEAK":"YES","CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING":"YES","CLANG_WARN_BOOL_CONVERSION":"YES","CLANG_WARN_COMMA":"YES","CLANG_WARN_CONSTANT_CONVERSION":"YES","CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS":"YES","CLANG_WARN_DIRECT_OBJC_ISA_USAGE":"YES_ERROR","CLANG_WARN_DOCUMENTATION_COMMENTS":"YES","CLANG_WARN_EMPTY_BODY":"YES","CLANG_WARN_ENUM_CONVERSION":"YES","CLANG_WARN_INFINITE_RECURSION":"YES","CLANG_WARN_INT_CONVERSION":"YES","CLANG_WARN_NON_LITERAL_NULL_CONVERSION":"YES","CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF":"YES","CLANG_WARN_OBJC_LITERAL_CONVERSION":"YES","CLANG_WARN_OBJC_ROOT_CLASS":"YES_ERROR","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"YES","CLANG_WARN_RANGE_LOOP_ANALYSIS":"YES","CLANG_WARN_STRICT_PROTOTYPES":"YES","CLANG_WARN_SUSPICIOUS_MOVE":"YES","CLANG_WARN_UNGUARDED_AVAILABILITY":"YES_AGGRESSIVE","CLANG_WARN_UNREACHABLE_CODE":"YES","CLANG_WARN__DUPLICATE_METHOD_MATCH":"YES","COPY_PHASE_STRIP":"NO","DEBUG_INFORMATION_FORMAT":"dwarf-with-dsym","ENABLE_NS_ASSERTIONS":"NO","ENABLE_STRICT_OBJC_MSGSEND":"YES","GCC_C_LANGUAGE_STANDARD":"gnu11","GCC_NO_COMMON_BLOCKS":"YES","GCC_PREPROCESSOR_DEFINITIONS":"POD_CONFIGURATION_PROFILE=1 $(inherited)","GCC_WARN_64_TO_32_BIT_CONVERSION":"YES","GCC_WARN_ABOUT_RETURN_TYPE":"YES_ERROR","GCC_WARN_UNDECLARED_SELECTOR":"YES","GCC_WARN_UNINITIALIZED_AUTOS":"YES_AGGRESSIVE","GCC_WARN_UNUSED_FUNCTION":"YES","GCC_WARN_UNUSED_VARIABLE":"YES","IPHONEOS_DEPLOYMENT_TARGET":"13.0","MTL_ENABLE_DEBUG_INFO":"NO","MTL_FAST_MATH":"YES","PRODUCT_NAME":"$(TARGET_NAME)","STRIP_INSTALLED_PRODUCT":"NO","SWIFT_COMPILATION_MODE":"wholemodule","SWIFT_OPTIMIZATION_LEVEL":"-O","SWIFT_VERSION":"5.0","SYMROOT":"${SRCROOT}/../build"},"guid":"bfdfe7dc352907fc980b868725387e98431d6fbac4fcf14f03a16b06b7267016","name":"Profile"},{"buildSettings":{"ALWAYS_SEARCH_USER_PATHS":"NO","CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED":"YES","CLANG_ANALYZER_NONNULL":"YES","CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION":"YES_AGGRESSIVE","CLANG_CXX_LANGUAGE_STANDARD":"gnu++14","CLANG_CXX_LIBRARY":"libc++","CLANG_ENABLE_MODULES":"YES","CLANG_ENABLE_OBJC_ARC":"YES","CLANG_ENABLE_OBJC_WEAK":"YES","CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING":"YES","CLANG_WARN_BOOL_CONVERSION":"YES","CLANG_WARN_COMMA":"YES","CLANG_WARN_CONSTANT_CONVERSION":"YES","CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS":"YES","CLANG_WARN_DIRECT_OBJC_ISA_USAGE":"YES_ERROR","CLANG_WARN_DOCUMENTLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e9807dced212da9d57ff037610b6063ab15","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/SDWebImage/SDWebImage-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/SDWebImage/SDWebImage-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/SDWebImage/SDWebImage.modulemap","ONLY_ACTIVE_ARCH":"NO","PRODUCT_MODULE_NAME":"SDWebImage","PRODUCT_NAME":"SDWebImage","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98589ff266d192c09051f93298f2daa9a5","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e9817591ddf25ade48b1de942ba4d9a652c","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/SDWebImage/SDWebImage-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/SDWebImage/SDWebImage-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/SDWebImage/SDWebImage.modulemap","PRODUCT_MODULE_NAME":"SDWebImage","PRODUCT_NAME":"SDWebImage","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e9895143d94b34658a94778e629a50709d2","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e9817591ddf25ade48b1de942ba4d9a652c","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/SDWebImage/SDWebImage-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/SDWebImage/SDWebImage-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/SDWebImage/SDWebImage.modulemap","PRODUCT_MODULE_NAME":"SDWebImage","PRODUCT_NAME":"SDWebImage","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e982cd6ac18b02fdae827a3b91521449ce1","name":"Release"}],"buildPhases":[{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e984ef5f54b72a7372aba1e579dc0ccd846","guid":"bfdfe7dc352907fc980b868725387e983466130875812026d2ffd41bd84ff6bc","headerVisibility":"private"},{"fileReference":"bfdfe7dc352907fc980b868725387e983c9e4b25cc4f3d4a01ef0e2732f2904d","guid":"bfdfe7dc352907fc980b868725387e98c1a17c4251769d2ae9e44f5c112f7f9b","headerVisibility":"public"},{"fileReference":"bfdfe7dc352907fc980b868725387e986cf82ded5cbcd0aedb1e047492bd59f4","guid":"bfdfe7dc352907fc980b868725387e98fe19933aae33539efd1f4e1ca4dc2e84","headerVisibility":"public"},{"fileReference":"bfdfe7dc352907fc980b868725387e98327653faf119453e0c6aec2865862035","guid":"bfdfe7dc352907fc980b868725387e98a5088909540cd2cafeaaf8a4c05e9576","headerVisibility":"public"},{"fileReference":"bfdfe7dc352907fc980b868725387e9822231aaaedf7df013e4b108e0e6fd285","guid":"bfdfe7dc352907fc980b868725387e98703235191994a43429ab69010353e6a3","headerVisibility":"public"},{"fileReference":"bfdfe7dc352907fc980b868725387e989aaed392d2dd6ac61db9e4ecbcf25857","guid":"bLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98d19afb1410fae17f549fed9dd2d1b8c3","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/url_launcher_ios/url_launcher_ios-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/url_launcher_ios/url_launcher_ios-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"13.0","MODULEMAP_FILE":"Target Support Files/url_launcher_ios/url_launcher_ios.modulemap","ONLY_ACTIVE_ARCH":"NO","OTHER_LDFLAGS":"$(inherited) -framework Flutter","PRODUCT_MODULE_NAME":"url_launcher_ios","PRODUCT_NAME":"url_launcher_ios","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98afb629f0dcc255b13d82c9ababfaf54f","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f9a4bf43cf6f978b20d8a9ce206deac9","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/url_launcher_ios/url_launcher_ios-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/url_launcher_ios/url_launcher_ios-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"13.0","MODULEMAP_FILE":"Target Support Files/url_launcher_ios/url_launcher_ios.modulemap","OTHER_LDFLAGS":"$(inherited) -framework Flutter","PRODUCT_MODULE_NAME":"url_launcher_ios","PRODUCT_NAME":"url_launcher_ios","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e9879db561c8b08d043bb6ba1bb3996219a","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f9a4bf43cf6f978b20d8a9ce206deac9","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/url_launcher_ios/url_launcher_ios-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/url_launcher_ios/url_launcher_ios-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)Line truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98a92e512aac87655ee7918ffca1bc6995","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/shared_preferences_foundation/shared_preferences_foundation-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/shared_preferences_foundation/shared_preferences_foundation-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"13.0","MODULEMAP_FILE":"Target Support Files/shared_preferences_foundation/shared_preferences_foundation.modulemap","ONLY_ACTIVE_ARCH":"NO","OTHER_LDFLAGS":"$(inherited) -framework Flutter","PRODUCT_MODULE_NAME":"shared_preferences_foundation","PRODUCT_NAME":"shared_preferences_foundation","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98070d049bc9f33d4eedf57f66e50812a1","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98eb9d36647a0bea0e4eb1b12f12d263d4","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/shared_preferences_foundation/shared_preferences_foundation-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/shared_preferences_foundation/shared_preferences_foundation-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"13.0","MODULEMAP_FILE":"Target Support Files/shared_preferences_foundation/shared_preferences_foundation.modulemap","OTHER_LDFLAGS":"$(inherited) -framework Flutter","PRODUCT_MODULE_NAME":"shared_preferences_foundation","PRODUCT_NAME":"shared_preferences_foundation","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e9844e5c4b35c406f6d23ac5779a73cf27a","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98eb9d36647a0bea0e4eb1b12f12d263d4","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target SuppLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98e627b81f2277a26392e82dc437b640b9","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/DKImagePickerController/DKImagePickerController-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/DKImagePickerController/DKImagePickerController-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/DKImagePickerController/DKImagePickerController.modulemap","ONLY_ACTIVE_ARCH":"NO","PRODUCT_MODULE_NAME":"DKImagePickerController","PRODUCT_NAME":"DKImagePickerController","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5","TARGETED_DEVICE_FAMILY":"1,2","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e987c1a49d2eb4928f38153fbb752b43f0d","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e984b6d27ca3f133a8809ce8858835ba048","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/DKImagePickerController/DKImagePickerController-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/DKImagePickerController/DKImagePickerController-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/DKImagePickerController/DKImagePickerController.modulemap","PRODUCT_MODULE_NAME":"DKImagePickerController","PRODUCT_NAME":"DKImagePickerController","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e981a061109697a6fecb5c4052027830873","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e984b6d27ca3f133a8809ce8858835ba048","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/DKImagePickerController/DKImagePickerController-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/DKImagePickerController/DKImagePickerController-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/DKImagePickerController/DKImagePickerController.modulemap","PRODUCT_MODULE_NAME":"DKImagePickerController","PRODUCT_NAME":"DKImagePickerController","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e984a2bfc0afebe00a97dd280fbd3b086c7","name":"Release"}],"buildPhases":[{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e985ab2e42ee779365312a2e5508ae2de1e","guid":"bfdfe7dc352907fc980b868725387e98305321bb0f6c61d76ab6f8f834f9e1bc","headerVisibility":"public"}],"guid":"bfdfe7dc352907fc980b868725387e989c7318c71e29c5c2fa728fab937f84e4","type":"com.apple.buildphase.headers"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e988f763bf4ea79de6aab5b94580ae10b71","guid":"bfdfe7dc352907fc980b868725387e986b9c07eb90d1c19fb7ac9f978eac2cfd"},{"fileReference":"bfdfe7dc352907fc980b868725387e988cc10f8287258333398e1ad06a4a08a3","guid":"bfdfe7dc352907fc980b868725387e9899bf2eef86ec86d3071d0464ba311bc3"},{"fileReference":"bfdfe7dc352907fc980b868725387e98ca1aaf1416f26af2ae5f25634becd9c4","guidLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e988d017df6eb26a1783b874214268dea26","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/SwiftyGif/SwiftyGif-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/SwiftyGif/SwiftyGif-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/SwiftyGif/SwiftyGif.modulemap","ONLY_ACTIVE_ARCH":"NO","PRODUCT_MODULE_NAME":"SwiftyGif","PRODUCT_NAME":"SwiftyGif","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98b3205f3116e5af79da6242c30607f7d1","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f191c54bfc8bd2078a4337a8bbbe4787","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/SwiftyGif/SwiftyGif-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/SwiftyGif/SwiftyGif-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/SwiftyGif/SwiftyGif.modulemap","PRODUCT_MODULE_NAME":"SwiftyGif","PRODUCT_NAME":"SwiftyGif","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98f0a64e5762baa3d7b1dc00cef11ac21f","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f191c54bfc8bd2078a4337a8bbbe4787","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/SwiftyGif/SwiftyGif-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/SwiftyGif/SwiftyGif-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/SwiftyGif/SwiftyGif.modulemap","PRODUCT_MODULE_NAME":"SwiftyGif","PRODUCT_NAME":"SwiftyGif","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98f543cf7ce936c0f554d4d3da1445c6be","name":"Release"}],"buildPhases":[{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e98841e69c77a33c992a383444bcd690833","guid":"bfdfe7dc352907fc980b868725387e98de51224ce0e2c5cbb8a4b350ca6d0b25","headerVisibility":"public"},{"fileReference":"bfdfe7dc352907fc980b868725387e986b9414b84d9ae46c6cfb7c8966e95c73","guid":"bfdfe7dc352907fc980b868725387e98a1722bb4c6e5d6fcf7c8a9004b3151d5","headerVisibility":"public"}],"guid":"bfdfe7dc352907fc980b868725387e98bb99cdc50bd77debe142c41be23cfad4","type":"com.apple.buildphase.headers"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e98e5ec22b9c4ec919ca16aaf1106fdfda7","guid":"bfdfe7dc352907fc980b868725387e989801564cf134465898eabb9cdc3bb4a2"},{"fileReference":"bfdfe7dc352907fc980b868725387e98c1f3f2ed47d0040183997f8bbf5e6ac1","guid":"bfdfe7dc352907fc980b868725387e98500cf1800c2248d2c3e147cb95487cf1"},{"fileReference":"bfdfe7dc352907fc980b868725387e987b5362145f0a8c83082dc613a6cf5234","guid":"bfdfe7dc352907fc980b868725387e9804baa42908b083470f90dc34fafa0576"},{"fileReference":"bfdfe7dc352907fc980b868725387e98ec31ea89f37bf925e7a4e91Line truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98e627b81f2277a26392e82dc437b640b9","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/DKImagePickerController","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"DKImagePickerController","INFOPLIST_FILE":"Target Support Files/DKImagePickerController/ResourceBundle-DKImagePickerController-DKImagePickerController-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","ONLY_ACTIVE_ARCH":"NO","PRODUCT_NAME":"DKImagePickerController","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98ccdaadd370001048c02574c5a730a1cb","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e984b6d27ca3f133a8809ce8858835ba048","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/DKImagePickerController","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"DKImagePickerController","INFOPLIST_FILE":"Target Support Files/DKImagePickerController/ResourceBundle-DKImagePickerController-DKImagePickerController-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","PRODUCT_NAME":"DKImagePickerController","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e9869e01d4cc4b1de8f6b4d48853d42af0a","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e984b6d27ca3f133a8809ce8858835ba048","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/DKImagePickerController","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"DKImagePickerController","INFOPLIST_FILE":"Target Support Files/DKImagePickerController/ResourceBundle-DKImagePickerController-DKImagePickerController-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","PRODUCT_NAME":"DKImagePickerController","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e9863cc5f78b7c7591a7028ad9c898e9256","name":"Release"}],"buildPhases":[{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e98056c92b9e84188b0df8b410586e6d745","type":"com.apple.buildphase.sources"},{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e98304eee79fee06d880a386653e91a935c","type":"com.apple.buildphase.frameworks"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e98a292699c7027eaa680bfe5da607e708f","guid":"bfdfe7dc352907fc980b868725387e98c73680d38a61f2dfc18a78011becb030"},{"fileReference":"bfdfe7dc352907fc980b868725387e9852b8cf46dbb173cb75a3b48bbfbb8858","guid":"bfdfe7dc352907fc980b868725387e988db719a71e0f9be89599c1db427236a2"},{"fileReference":"bfdfe7dc352907fc980b868725387e9835648ce799d62afd8c7500844a76b60e","guid":"bfdfe7dc352907fc980b868725387e98a38495d7306ed25cf32278e4df04032b"},{"fileReference":"bfdfe7dc352907fc980b868725387e981ff058d7b390b6f2003ce67e8d91cd71","guid":"bfdfe7dc352907fc980b868725387e98d8e36707dbea32d09f82162f629d7314"},{"fileReference":"bfdfe7dc352907fc980b868725387e98defb1e32e9bd8aba19d9a67f858e60b0","guid":"bfdfe7dc352907fc980b868725387e98ae0beb9538dc7ffe527e56175953c003"},{"fileReference":"bfdfe7dc352907fc980b868725387e9808a0a427f1edd3500994a26f3b1b4614","guid":"bfdfe7dc352907fc980b868725387e9870bd0014af056bf884e433a59898e6a5"},{"fileReference":"bfdfe7dc352907fc980b868725387e98a490e75903fb2b0a8fb899a90d4287ed","guid":"bfdfe7dc352907fc980b868725387e98e2cd9695a6ea4b3f2c471c4380f6fac8"},{"fileReference":"bfdfe7dc352907fc980b868725387e987c76b719348323ba9f42f0d81d70b161","guid":"bfdfe7dc352907fc980b868725387e98ea2bb30bc70b51a188a1222265ae5c10"},{"fileReference":"bfdfe7dc352907fc980b868725387e980962a367e6152e96b70a125d815020af","guid":"bfdfe7dc352907fc980b868725387e98458888e8b20f35ca08283f2813b2b844"},{"fileReference":"bfdfe7dc352907fc980b868725387e980a11f800dc26d56426f6b37f8a283b0b","guid":"bfdfe7dc352907fc980b868725387e989018e231d883a82d3cd93a1efdad182e"},{"fileReference":"bfdfe7dc352907fc980b868725387e98b08b2c243127aba3d1fc2398f7ba08f3","guid":"bfdfe7dc352907fc980b868725387e980d8cec8b0d16e9f63b9976923d595400"},{"fileReference":"bfdfe7dc352907fc980b868725387e989796f8ce5b602046976a913145a66f6c","guid":"bfdfe7dc352907fc980b868725387e9819608d879b2a9a5eda827bef93d57b02"},{"fileReference":"bfdfe7dc352907fc980b868725387e986968906746efa810a96cf74bfa70670d","guid":"bfdfe7dc352907fc980b868725387e9855ef9023701231eeef844df884b26130"},{"fileReference":"bfdfe7dc352907fc980b868725387e98936c99140c6d493cc2084861c68133a2","guid":"bfdfe7dc352907fc980b868725387e98ef65b185b894b7230ad287ab4245cb2Line truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e986175ec003efd0925b0e80b27c1a333bb","buildSettings":{"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES":"NO","CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","INFOPLIST_FILE":"Target Support Files/Pods-Runner/Pods-Runner-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"13.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MACH_O_TYPE":"staticlib","MODULEMAP_FILE":"Target Support Files/Pods-Runner/Pods-Runner.modulemap","ONLY_ACTIVE_ARCH":"NO","OTHER_LDFLAGS":"$(inherited) -framework Flutter","OTHER_LIBTOOLFLAGS":"","PODS_ROOT":"$(SRCROOT)","PRODUCT_BUNDLE_IDENTIFIER":"org.cocoapods.${PRODUCT_NAME:rfc1034identifier}","PRODUCT_NAME":"$(TARGET_NAME:c99extidentifier)","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98e2a60c11c5a70510fcc06cdb050005c8","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e981c04a92782605bedf8b5bd015c8dc01a","buildSettings":{"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES":"NO","CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","INFOPLIST_FILE":"Target Support Files/Pods-Runner/Pods-Runner-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"13.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MACH_O_TYPE":"staticlib","MODULEMAP_FILE":"Target Support Files/Pods-Runner/Pods-Runner.modulemap","OTHER_LDFLAGS":"$(inherited) -framework Flutter","OTHER_LIBTOOLFLAGS":"","PODS_ROOT":"$(SRCROOT)","PRODUCT_BUNDLE_IDENTIFIER":"org.cocoapods.${PRODUCT_NAME:rfc1034identifier}","PRODUCT_NAME":"$(TARGET_NAME:c99extidentifier)","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e982287b8fb98c1f7c516df4dadee62abbc","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98ab5e5b11fcf9a2f9f4c2bf61b3a5e465","buildSettings":{"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES":"NO","CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","INFOPLIST_FILE":"Target Support Files/Pods-Runner/Pods-Runner-Info.plist","INSTALL_PATH":"$(LLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98a92e512aac87655ee7918ffca1bc6995","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/shared_preferences_foundation","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"shared_preferences_foundation","INFOPLIST_FILE":"Target Support Files/shared_preferences_foundation/ResourceBundle-shared_preferences_foundation_privacy-shared_preferences_foundation-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"13.0","ONLY_ACTIVE_ARCH":"NO","PRODUCT_NAME":"shared_preferences_foundation_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e984802826e219cad638716cc06378c607e","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98eb9d36647a0bea0e4eb1b12f12d263d4","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/shared_preferences_foundation","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"shared_preferences_foundation","INFOPLIST_FILE":"Target Support Files/shared_preferences_foundation/ResourceBundle-shared_preferences_foundation_privacy-shared_preferences_foundation-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"13.0","PRODUCT_NAME":"shared_preferences_foundation_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98a1ad17034114cb52f7f849056d392c7a","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98eb9d36647a0bea0e4eb1b12f12d263d4","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/shared_preferences_foundation","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"shared_preferences_foundation","INFOPLIST_FILE":"Target Support Files/shared_preferences_foundation/ResourceBundle-shared_preferences_foundation_privacy-shared_preferences_foundation-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"13.0","PRODUCT_NAME":"shared_preferences_foundation_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e989fbd346fd967914618c3e55e88126def","name":"Release"}],"buildPhases":[{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e985b34d3d94c7297b17ebdd939920a5335","type":"com.apple.buildphase.sources"},{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e984e65cb865ec9b1e3f4706dfd3242653a","type":"com.apple.buildphase.frameworks"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e989650fb71357622ba252b738e43a44104","guid":"bfdfe7dc352907fc980b868725387e9850dd8cf9409e8c037247fe137484a0c1"}],"guid":"bfdfe7dc352907fc980b868725387e98779eade1953c19fc3c67514e4bddb762","type":"com.apple.buildphase.resources"}],"buildRules":[],"dependencies":[],"guid":"bfdfe7dc352907fc980b868725387e98e0be3b0d5ad56f1985578b1f97431765","name":"shared_preferences_foundation-shared_preferences_foundation_privacy","productReference":{"guid":"bfdfe7dc352907fc980b868725387e98ad625504a4c1e61077bbfd33bd1d1785","name":"shared_preferences_foundation_privacy.bundle","type":"product"},"productTypeIdentifier":"com.apple.product-type.bundle","provisioningSourceData":[{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Debug","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Profile","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Release","provisioningStyle":0}],"type":"standard"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98074a9b441078beef16a37aae33ee2900","buildSettings":{"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES":"NO","CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","INFOPLIST_FILE":"Target Support Files/Pods-RunnerTests/Pods-RunnerTests-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"13.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MACH_O_TYPE":"staticlib","MODULEMAP_FILE":"Target Support Files/Pods-RunnerTests/Pods-RunnerTests.modulemap","ONLY_ACTIVE_ARCH":"NO","OTHER_LDFLAGS":"$(inherited) -framework Flutter","OTHER_LIBTOOLFLAGS":"","PODS_ROOT":"$(SRCROOT)","PRODUCT_BUNDLE_IDENTIFIER":"org.cocoapods.${PRODUCT_NAME:rfc1034identifier}","PRODUCT_NAME":"$(TARGET_NAME:c99extidentifier)","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e980029bc42f3dda39154e9cd2e8ce213da","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e987bd2a5c12d5a72dad789e04e26dc5a25","buildSettings":{"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES":"NO","CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","INFOPLIST_FILE":"Target Support Files/Pods-RunnerTests/Pods-RunnerTests-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"13.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MACH_O_TYPE":"staticlib","MODULEMAP_FILE":"Target Support Files/Pods-RunnerTests/Pods-RunnerTests.modulemap","OTHER_LDFLAGS":"$(inherited) -framework Flutter","OTHER_LIBTOOLFLAGS":"","PODS_ROOT":"$(SRCROOT)","PRODUCT_BUNDLE_IDENTIFIER":"org.cocoapods.${PRODUCT_NAME:rfc1034identifier}","PRODUCT_NAME":"$(TARGET_NAME:c99extidentifier)","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98d15fe13ffb666b223bfd6ee9f0a6138e","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98fc46d149385d28a69f8f8bc860e81763","buildSettings":{"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES":"NO","CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","INFOPLIST_FILE":"Target Support Files/Pods-RunnerTestLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98dee49624fc73f0ae85aa8a082ba91fed","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/file_picker","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"file_picker","INFOPLIST_FILE":"Target Support Files/file_picker/ResourceBundle-file_picker_ios_privacy-file_picker-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"12.0","ONLY_ACTIVE_ARCH":"NO","PRODUCT_NAME":"file_picker_ios_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e983cf4f60d40ad9205184b36fb6af727b9","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f0255426bc1673d88b46486c8fd69422","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/file_picker","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"file_picker","INFOPLIST_FILE":"Target Support Files/file_picker/ResourceBundle-file_picker_ios_privacy-file_picker-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"12.0","PRODUCT_NAME":"file_picker_ios_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98b186591f3824f4a621d439f4b541ce7c","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f0255426bc1673d88b46486c8fd69422","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/file_picker","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"file_picker","INFOPLIST_FILE":"Target Support Files/file_picker/ResourceBundle-file_picker_ios_privacy-file_picker-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"12.0","PRODUCT_NAME":"file_picker_ios_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e981e6e50dceabeba556a6d4b0882d8fe0d","name":"Release"}],"buildPhases":[{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e98380bdff95ee6dba6ad06320ee59f7d1e","type":"com.apple.buildphase.sources"},{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e9895b84bdfdbfc3d5cd91174a50d20b314","type":"com.apple.buildphase.frameworks"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e98a4fc28bd55db19e7dd9770669b64c8ae","guid":"bfdfe7dc352907fc980b868725387e98184a2985baae916458080126fbe196a9"}],"guid":"bfdfe7dc352907fc980b868725387e987fda5a18f5aeedbcbfec6fae8a7b0fb5","type":"com.apple.buildphase.resources"}],"buildRules":[],"dependencies":[],"guid":"bfdfe7dc352907fc980b868725387e985452a642045cac0ef7c37f93da2d994e","name":"file_picker-file_picker_ios_privacy","productReference":{"guid":"bfdfe7dc352907fc980b868725387e985ae769d0b989789f9e90cfb215ac5a2e","name":"file_picker_ios_privacy.bundle","type":"product"},"productTypeIdentifier":"com.apple.product-type.bundle","provisioningSourceData":[{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Debug","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Profile","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Release","provisioningStyle":0}],"type":"standard"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98d19afb1410fae17f549fed9dd2d1b8c3","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/url_launcher_ios","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"url_launcher_ios","INFOPLIST_FILE":"Target Support Files/url_launcher_ios/ResourceBundle-url_launcher_ios_privacy-url_launcher_ios-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"13.0","ONLY_ACTIVE_ARCH":"NO","PRODUCT_NAME":"url_launcher_ios_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e981bfbda52aa669fd115434bf083d61c55","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f9a4bf43cf6f978b20d8a9ce206deac9","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/url_launcher_ios","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"url_launcher_ios","INFOPLIST_FILE":"Target Support Files/url_launcher_ios/ResourceBundle-url_launcher_ios_privacy-url_launcher_ios-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"13.0","PRODUCT_NAME":"url_launcher_ios_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98a969866b678fd5b24e79b96d2b979381","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f9a4bf43cf6f978b20d8a9ce206deac9","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/url_launcher_ios","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"url_launcher_ios","INFOPLIST_FILE":"Target Support Files/url_launcher_ios/ResourceBundle-url_launcher_ios_privacy-url_launcher_ios-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"13.0","PRODUCT_NAME":"url_launcher_ios_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98d2618c2e407d10b8d3cea1e48cd48660","name":"Release"}],"buildPhases":[{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e98ac1800eae43f994e8fc52434d00e6c20","type":"com.apple.buildphase.sources"},{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e98f408810c5b5c3f4a72f416737c13e810","type":"com.apple.buildphase.frameworks"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e98b7249c6b1f45282221821a550722db73","guid":"bfdfe7dc352907fc980b868725387e9870f11cac42c43619587628e3320ac7c4"}],"guid":"bfdfe7dc352907fc980b868725387e98f40bae0d89fd070f88d815598548da06","type":"com.apple.buildphase.resources"}],"buildRules":[],"dependencies":[],"guid":"bfdfe7dc352907fc980b868725387e9891b3b8cc56823cdea4b418e009a423b2","name":"url_launcher_ios-url_launcher_ios_privacy","productReference":{"guid":"bfdfe7dc352907fc980b868725387e9827df8da513ac7d6928fc311b53a7155d","name":"url_launcher_ios_privacy.bundle","type":"product"},"productTypeIdentifier":"com.apple.product-type.bundle","provisioningSourceData":[{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Debug","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Profile","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Release","provisioningStyle":0}],"type":"standard"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e983c6363c1b6260613b6af5dae89e50fa6","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/app_links/app_links-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/app_links/app_links-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"13.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/app_links/app_links.modulemap","ONLY_ACTIVE_ARCH":"NO","OTHER_LDFLAGS":"$(inherited) -framework Flutter","PRODUCT_MODULE_NAME":"app_links","PRODUCT_NAME":"app_links","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98c8579567ee227a2b71c22abd5778dcf9","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98fd8cfcfe7c3fb0ac9ed7c1a13704b3d5","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/app_links/app_links-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/app_links/app_links-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"13.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/app_links/app_links.modulemap","OTHER_LDFLAGS":"$(inherited) -framework Flutter","PRODUCT_MODULE_NAME":"app_links","PRODUCT_NAME":"app_links","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e984324a992fa364badc4f65f29947547e8","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98fd8cfcfe7c3fb0ac9ed7c1a13704b3d5","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/app_links/app_links-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/app_links/app_links-InLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e9807dced212da9d57ff037610b6063ab15","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/SDWebImage","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"SDWebImage","INFOPLIST_FILE":"Target Support Files/SDWebImage/ResourceBundle-SDWebImage-SDWebImage-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","ONLY_ACTIVE_ARCH":"NO","PRODUCT_NAME":"SDWebImage","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98f2847d1ca9a69889f6d0383fbfe18bbe","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e9817591ddf25ade48b1de942ba4d9a652c","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/SDWebImage","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"SDWebImage","INFOPLIST_FILE":"Target Support Files/SDWebImage/ResourceBundle-SDWebImage-SDWebImage-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","PRODUCT_NAME":"SDWebImage","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98ebd2f87fefc5272aaf378cf5ff5936df","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e9817591ddf25ade48b1de942ba4d9a652c","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/SDWebImage","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"SDWebImage","INFOPLIST_FILE":"Target Support Files/SDWebImage/ResourceBundle-SDWebImage-SDWebImage-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","PRODUCT_NAME":"SDWebImage","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e9828e8935feafbaaf55e1e006e435a39fe","name":"Release"}],"buildPhases":[{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e98c10b3281508b66e43344cb8a9928813b","type":"com.apple.buildphase.sources"},{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e9855f13db31621782dce3ed78a1192533f","type":"com.apple.buildphase.frameworks"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e98072810b3f251fe9adc8a780b3ece2d19","guid":"bfdfe7dc352907fc980b868725387e9849ff24d1c510c75bcd71236fbddf505a"}],"guid":"bfdfe7dc352907fc980b868725387e98fd0472846197a19fd67e8535dead924f","type":"com.apple.buildphase.resources"}],"buildRules":[],"dependencies":[],"guid":"bfdfe7dc352907fc980b868725387e9826e2628dc041aabe2d77e75ccb1dc95b","name":"SDWebImage-SDWebImage","productReference":{"guid":"bfdfe7dc352907fc980b868725387e986798c379d76b6055dc2d719d4bd63a69","name":"SDWebImage.bundle","type":"product"},"productTypeIdentifier":"com.apple.product-type.bundle","provisioningSourceData":[{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Debug","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Profile","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Release","provisioningStyle":0}],"type":"standard"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e988d017df6eb26a1783b874214268dea26","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/SwiftyGif","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"SwiftyGif","INFOPLIST_FILE":"Target Support Files/SwiftyGif/ResourceBundle-SwiftyGif-SwiftyGif-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","ONLY_ACTIVE_ARCH":"NO","PRODUCT_NAME":"SwiftyGif","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e9867de03905444371c5e39754de7867f8c","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f191c54bfc8bd2078a4337a8bbbe4787","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/SwiftyGif","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"SwiftyGif","INFOPLIST_FILE":"Target Support Files/SwiftyGif/ResourceBundle-SwiftyGif-SwiftyGif-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","PRODUCT_NAME":"SwiftyGif","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e9897aa1261c5528aa7f556e942ebe441be","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f191c54bfc8bd2078a4337a8bbbe4787","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/SwiftyGif","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"SwiftyGif","INFOPLIST_FILE":"Target Support Files/SwiftyGif/ResourceBundle-SwiftyGif-SwiftyGif-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","PRODUCT_NAME":"SwiftyGif","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98593050ea014300305b2fa837012aabba","name":"Release"}],"buildPhases":[{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e98638550c4be065837c4a93674af9a7642","type":"com.apple.buildphase.sources"},{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e987b1994435d5ecf9645b379eeb8560721","type":"com.apple.buildphase.frameworks"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e9818ad385274ce64def8d4f9f9ce74f574","guid":"bfdfe7dc352907fc980b868725387e98a99318934ecfdc1e03033f5e13134f6e"}],"guid":"bfdfe7dc352907fc980b868725387e982819ba3f86839bd3cffd437aa85cc34c","type":"com.apple.buildphase.resources"}],"buildRules":[],"dependencies":[],"guid":"bfdfe7dc352907fc980b868725387e98f5cd644fc2aeb8654450a2168f52697c","name":"SwiftyGif-SwiftyGif","productReference":{"guid":"bfdfe7dc352907fc980b868725387e9824d08d80a11ec6e34ca1c1e17eca0844","name":"SwiftyGif.bundle","type":"product"},"productTypeIdentifier":"com.apple.product-type.bundle","provisioningSourceData":[{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Debug","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Profile","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Release","provisioningStyle":0}],"type":"standard"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98dee49624fc73f0ae85aa8a082ba91fed","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/file_picker/file_picker-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/file_picker/file_picker-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/file_picker/file_picker.modulemap","ONLY_ACTIVE_ARCH":"NO","OTHER_LDFLAGS":"$(inherited) -framework Flutter","PRODUCT_MODULE_NAME":"file_picker","PRODUCT_NAME":"file_picker","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98b3839b441583705f02a5120c8d8aa8af","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f0255426bc1673d88b46486c8fd69422","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/file_picker/file_picker-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/file_picker/file_picker-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/file_picker/file_picker.modulemap","OTHER_LDFLAGS":"$(inherited) -framework Flutter","PRODUCT_MODULE_NAME":"file_picker","PRODUCT_NAME":"file_picker","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5.0","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VALID_ARCHS[sdk=iphonesimulator*]":"$(ARCHS_STANDARD)","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98bf7c85eda27e5e9e0261324bd88a67cb","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98f0255426bc1673d88b46486c8fd69422","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER":"NO","CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_BITCODE":"NO","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","EXCLUDED_ARCHS[sdk=iphoneos*]":"$(inherited) armv7","EXCLUDED_ARCHS[sdk=iphonesimulator*]":"$(inherited) i386","FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64\" $(inherited)","FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]":"\"/Users/mark/sdk/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator\" $(inherited)","GCC_PREFIX_HEADER":"Target Support Files/file_picker/file_picker-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target SupLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98ae529f76a1aeb84aed676cbc438f2337","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/DKPhotoGallery/DKPhotoGallery-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/DKPhotoGallery/DKPhotoGallery-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/DKPhotoGallery/DKPhotoGallery.modulemap","ONLY_ACTIVE_ARCH":"NO","PRODUCT_MODULE_NAME":"DKPhotoGallery","PRODUCT_NAME":"DKPhotoGallery","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5","TARGETED_DEVICE_FAMILY":"1,2","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e9812a3e31c7a3658cff33e391a712abfee","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e987c0ad1a68339e983c25e4de21965f4a8","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/DKPhotoGallery/DKPhotoGallery-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/DKPhotoGallery/DKPhotoGallery-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/DKPhotoGallery/DKPhotoGallery.modulemap","PRODUCT_MODULE_NAME":"DKPhotoGallery","PRODUCT_NAME":"DKPhotoGallery","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e98c22b62655b6be12853c1b5cd5fd652dd","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e987c0ad1a68339e983c25e4de21965f4a8","buildSettings":{"CODE_SIGN_IDENTITY[sdk=appletvos*]":"","CODE_SIGN_IDENTITY[sdk=iphoneos*]":"","CODE_SIGN_IDENTITY[sdk=watchos*]":"","CURRENT_PROJECT_VERSION":"1","DEFINES_MODULE":"YES","DYLIB_COMPATIBILITY_VERSION":"1","DYLIB_CURRENT_VERSION":"1","DYLIB_INSTALL_NAME_BASE":"@rpath","ENABLE_MODULE_VERIFIER":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","GCC_PREFIX_HEADER":"Target Support Files/DKPhotoGallery/DKPhotoGallery-prefix.pch","GENERATE_INFOPLIST_FILE":"NO","INFOPLIST_FILE":"Target Support Files/DKPhotoGallery/DKPhotoGallery-Info.plist","INSTALL_PATH":"$(LOCAL_LIBRARY_DIR)/Frameworks","IPHONEOS_DEPLOYMENT_TARGET":"9.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks @loader_path/Frameworks","MODULEMAP_FILE":"Target Support Files/DKPhotoGallery/DKPhotoGallery.modulemap","PRODUCT_MODULE_NAME":"DKPhotoGallery","PRODUCT_NAME":"DKPhotoGallery","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","SWIFT_ACTIVE_COMPILATION_CONDITIONS":"$(inherited) ","SWIFT_INSTALL_OBJC_HEADER":"YES","SWIFT_VERSION":"5","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","VERSIONING_SYSTEM":"apple-generic","VERSION_INFO_PREFIX":""},"guid":"bfdfe7dc352907fc980b868725387e9848fe5408463f346fa5b361b3cedb54de","name":"Release"}],"buildPhases":[{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e98e61c3706c4c5522b7ecd10e962efb922","guid":"bfdfe7dc352907fc980b868725387e988f3eec976e8ea74bbf5d7cd0b5f67f79","headerVisibility":"public"}],"guid":"bfdfe7dc352907fc980b868725387e98e9d4857b7750471589c9720743ea3b25","type":"com.apple.buildphase.headers"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e986cd8b63f1efadf20d9ea1ed8f5a55c59","guid":"bfdfe7dc352907fc980b868725387e9815d3d68fd43cc594f1d83dbf5a16bf0e"},{"fileReference":"bfdfe7dc352907fc980b868725387e98d637eecdfef95bbdf30369120352bd46","guid":"bfdfe7dc352907fc980b868725387e980a4bac17f61a14113e14ed5b4442e9f7"},{"fileReference":"bfdfe7dc352907fc980b868725387e9834be2bf990d387cbce4913d90fc0866d","guid":"bfdfe7dc352907fc980b868725387e98021a7b18180da4bcfd722853617e831b"},{"fileReference":"bfdfe7dc352907fc980b868725387e984767f7ebe824e56e6af065bd8c127fb1","guid":"bfdfe7dc352907fc980b868725387e98fbd84374a47a123c65e38dLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98b84d960f6c511b37f7394026ec602a26","buildSettings":{"ASSETCATALOG_COMPILER_APPICON_NAME":"AppIcon","ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME":"AccentColor","CLANG_ENABLE_OBJC_WEAK":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","IPHONEOS_DEPLOYMENT_TARGET":"13.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks","ONLY_ACTIVE_ARCH":"NO","SDKROOT":"iphoneos","TARGETED_DEVICE_FAMILY":"1,2"},"guid":"bfdfe7dc352907fc980b868725387e980bc977b873df9b0e01b3c822e5c77429","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e989f6375ee0579bba7a5de7839408dc6de","buildSettings":{"ASSETCATALOG_COMPILER_APPICON_NAME":"AppIcon","ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME":"AccentColor","CLANG_ENABLE_OBJC_WEAK":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","IPHONEOS_DEPLOYMENT_TARGET":"13.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks","SDKROOT":"iphoneos","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES"},"guid":"bfdfe7dc352907fc980b868725387e98b75274b69084014a6a5ac37ea7a9d4bc","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e989f6375ee0579bba7a5de7839408dc6de","buildSettings":{"ASSETCATALOG_COMPILER_APPICON_NAME":"AppIcon","ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME":"AccentColor","CLANG_ENABLE_OBJC_WEAK":"NO","ENABLE_USER_SCRIPT_SANDBOXING":"NO","IPHONEOS_DEPLOYMENT_TARGET":"13.0","LD_RUNPATH_SEARCH_PATHS":"$(inherited) @executable_path/Frameworks","SDKROOT":"iphoneos","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES"},"guid":"bfdfe7dc352907fc980b868725387e988b8e6347e534cb57e9bb1b22dc47b716","name":"Release"}],"buildPhases":[],"buildRules":[],"dependencies":[],"guid":"bfdfe7dc352907fc980b868725387e989da425bb6d6d5d8dbb95e4afffb82217","name":"Flutter","provisioningSourceData":[{"bundleIdentifierFromInfoPlist":"","configurationName":"Debug","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"","configurationName":"Profile","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"","configurationName":"Release","provisioningStyle":0}],"type":"aggregate"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e983c6363c1b6260613b6af5dae89e50fa6","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/app_links","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"app_links","INFOPLIST_FILE":"Target Support Files/app_links/ResourceBundle-app_links_ios_privacy-app_links-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"13.0","ONLY_ACTIVE_ARCH":"NO","PRODUCT_NAME":"app_links_ios_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e982ac99f10f6822515e6781ade0cb9cc64","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98fd8cfcfe7c3fb0ac9ed7c1a13704b3d5","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/app_links","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"app_links","INFOPLIST_FILE":"Target Support Files/app_links/ResourceBundle-app_links_ios_privacy-app_links-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"13.0","PRODUCT_NAME":"app_links_ios_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98b86693991edc063c343b6123475d310d","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98fd8cfcfe7c3fb0ac9ed7c1a13704b3d5","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/app_links","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"app_links","INFOPLIST_FILE":"Target Support Files/app_links/ResourceBundle-app_links_ios_privacy-app_links-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"13.0","PRODUCT_NAME":"app_links_ios_privacy","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98240358b4530237925223b54410489dda","name":"Release"}],"buildPhases":[{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e980135adade744c093ad80fd47ec6ffbb9","type":"com.apple.buildphase.sources"},{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e98f4cf1832e1000167365d8c2092427e45","type":"com.apple.buildphase.frameworks"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e98eb6655bb0a0f69a2a11ac7bcc08afb0b","guid":"bfdfe7dc352907fc980b868725387e98c40d727f0ffc02a8e1adc3a93e93b868"}],"guid":"bfdfe7dc352907fc980b868725387e9887df74fdfbf5feb239f859edfda11764","type":"com.apple.buildphase.resources"}],"buildRules":[],"dependencies":[],"guid":"bfdfe7dc352907fc980b868725387e9854f2b496f3d836ac3fd0e138cbba7daf","name":"app_links-app_links_ios_privacy","productReference":{"guid":"bfdfe7dc352907fc980b868725387e98b94b436e886ef04c570b7ebe5735692f","name":"app_links_ios_privacy.bundle","type":"product"},"productTypeIdentifier":"com.apple.product-type.bundle","provisioningSourceData":[{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Debug","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Profile","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Release","provisioningStyle":0}],"type":"standard"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"buildConfigurations":[{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e98ae529f76a1aeb84aed676cbc438f2337","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/DKPhotoGallery","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"DKPhotoGallery","INFOPLIST_FILE":"Target Support Files/DKPhotoGallery/ResourceBundle-DKPhotoGallery-DKPhotoGallery-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","ONLY_ACTIVE_ARCH":"NO","PRODUCT_NAME":"DKPhotoGallery","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e981035c23725d6f669f16922d106add07e","name":"Debug"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e987c0ad1a68339e983c25e4de21965f4a8","buildSettings":{"CLANG_ENABLE_OBJC_WEAK":"NO","CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/DKPhotoGallery","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"DKPhotoGallery","INFOPLIST_FILE":"Target Support Files/DKPhotoGallery/ResourceBundle-DKPhotoGallery-DKPhotoGallery-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","PRODUCT_NAME":"DKPhotoGallery","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","VALIDATE_PRODUCT":"YES","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e98eb7ec1e525d112a6aba1f3086fbee501","name":"Profile"},{"baseConfigurationFileReference":"bfdfe7dc352907fc980b868725387e987c0ad1a68339e983c25e4de21965f4a8","buildSettings":{"CODE_SIGNING_ALLOWED":"NO","CODE_SIGNING_IDENTITY":"-","CODE_SIGNING_REQUIRED":"NO","CONFIGURATION_BUILD_DIR":"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/DKPhotoGallery","EXPANDED_CODE_SIGN_IDENTITY":"-","IBSC_MODULE":"DKPhotoGallery","INFOPLIST_FILE":"Target Support Files/DKPhotoGallery/ResourceBundle-DKPhotoGallery-DKPhotoGallery-Info.plist","IPHONEOS_DEPLOYMENT_TARGET":"9.0","PRODUCT_NAME":"DKPhotoGallery","SDKROOT":"iphoneos","SKIP_INSTALL":"YES","TARGETED_DEVICE_FAMILY":"1,2","WRAPPER_EXTENSION":"bundle"},"guid":"bfdfe7dc352907fc980b868725387e983adcaf42a588440a1bb41691dfef76ca","name":"Release"}],"buildPhases":[{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e98cc1885b82bae9e448d1d5b669e2df59d","type":"com.apple.buildphase.sources"},{"buildFiles":[],"guid":"bfdfe7dc352907fc980b868725387e98d88ef0264424cfcd4326446b5004219c","type":"com.apple.buildphase.frameworks"},{"buildFiles":[{"fileReference":"bfdfe7dc352907fc980b868725387e985e10b359dd12b7f39fea9ff06ea97d76","guid":"bfdfe7dc352907fc980b868725387e989b100093402c895020b150b32e00f0f1"},{"fileReference":"bfdfe7dc352907fc980b868725387e98a35234dbbe4590b9a85e7457f0c28ec1","guid":"bfdfe7dc352907fc980b868725387e987afd66ea9f01c8374bf0c92c615381ec"},{"fileReference":"bfdfe7dc352907fc980b868725387e98dee9c8b9a30b693ced32e187ebf0f900","guid":"bfdfe7dc352907fc980b868725387e981cc3d1b485ef7350fe25b708b26d9fbb"},{"fileReference":"bfdfe7dc352907fc980b868725387e98c41ed424f75c34475286f94a0c89533f","guid":"bfdfe7dc352907fc980b868725387e98f5a24a20e079e6784c0fcedf2fcdf3b4"},{"fileReference":"bfdfe7dc352907fc980b868725387e98561ed8ca05356672713bcaada5ce132e","guid":"bfdfe7dc352907fc980b868725387e98426fa1286f9aa17aa26796db5772cbd6"}],"guid":"bfdfe7dc352907fc980b868725387e98769785d34bbe4f415892ef12991c8b36","type":"com.apple.buildphase.resources"}],"buildRules":[],"dependencies":[],"guid":"bfdfe7dc352907fc980b868725387e98d3f65728b12dd217475d1283ee417937","name":"DKPhotoGallery-DKPhotoGallery","productReference":{"guid":"bfdfe7dc352907fc980b868725387e9845db4417944723d8b91f4a6c67e94d3c","name":"DKPhotoGallery.bundle","type":"product"},"productTypeIdentifier":"com.apple.product-type.bundle","provisioningSourceData":[{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Debug","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Profile","provisioningStyle":0},{"bundleIdentifierFromInfoPlist":"${PRODUCT_BUNDLE_IDENTIFIER}","configurationName":"Release","provisioningStyle":0}],"type":"standard"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"guid":"dc4b70c03e8043e50e38f2068887b1d4","name":"Pods","path":"/Users/mark/developingProjects/flux/ios/Pods/Pods.xcodeproj/project.xcworkspace","projects":["PROJECT@v11_mod=16ab0516af86f9c4da6cf0caecf5869c_hash=bfdfe7dc352907fc980b868725387e98plugins=1OJSG6M1FOV3XYQCBH7Z29RZ0FPR9XDE1"]}
|
||||
+150
-198
@@ -5,10 +5,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: _flutterfire_internals
|
||||
sha256: "78f98c1f9c4dbbd22c2bb7b7f17c4a5c06150e8b2cb791a0947979ad0d3dabd5"
|
||||
sha256: f6966125633a34f82d9be2ee895b755cff3554087b1d00a9eb884e5947f4bca9
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.73"
|
||||
version: "1.3.77"
|
||||
app_links:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -45,10 +45,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: archive
|
||||
sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff
|
||||
sha256: "6c5bcd986e06b94e3c40244af471750840a3d2341d1f9763a1100a14add517b4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.9"
|
||||
version: "4.3.0"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -133,18 +133,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||
sha256: e51d50bca3217c9a9fa2b41a30e4a38971133f5f9ec7a3d57bae095007f1d28e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
code_assets:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: code_assets
|
||||
sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
version: "1.1.3"
|
||||
collection:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -165,10 +157,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cross_file
|
||||
sha256: "92c9c43c383bfa1c32079d3bc492d55d6d4318044b7b47edaff8971cbb555c51"
|
||||
sha256: f141ea4f277af142a0356955707f6556f37b03947d39d55585981a06ca437bd6
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.5+4"
|
||||
version: "0.3.5+5"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -197,10 +189,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dbus
|
||||
sha256: "792974a4007974fbc5c1b5433eb2330a9db3e368c3f906253af4c007d0f49a91"
|
||||
sha256: a48d5da28e89bd02196e80d81ed8d7954923d00a0f4a68cc20b575038f023383
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.13"
|
||||
version: "0.7.15"
|
||||
equatable:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -213,10 +205,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: extension
|
||||
sha256: be3a6b7f8adad2f6e2e8c63c895d19811fcf203e23466c6296267941d0ff4f24
|
||||
sha256: "1d6cc5a2d173407284780b68fd94f2b547184d4190ca7dbf6d0bf43eb43c29d8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.0"
|
||||
version: "1.0.0"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -245,26 +237,26 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: file_picker
|
||||
sha256: f13a03000d942e476bc1ff0a736d2e9de711d2f89a95cd4c1d88f861c3348387
|
||||
sha256: "29cc1fdb20613876cc7afc529738c1c0f11a9ca159b010edad0c566ac330847e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.0.2"
|
||||
version: "11.0.3"
|
||||
file_selector_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file_selector_linux
|
||||
sha256: "2567f398e06ac72dcf2e98a0c95df2a9edd03c2c2e0cacd4780f20cdf56263a0"
|
||||
sha256: da76400e7872ce7637ffdce12749ec24169c25f6195c28372208e65a24bcd2ab
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.4"
|
||||
version: "0.9.4+1"
|
||||
file_selector_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file_selector_macos
|
||||
sha256: "5e0bbe9c312416f1787a68259ea1505b52f258c587f12920422671807c4d618a"
|
||||
sha256: d57c62362766b5e7ae739448650b66c6aab7a68ba7ecc65e04018652645ae0f4
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.5"
|
||||
version: "0.9.5+1"
|
||||
file_selector_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -277,58 +269,58 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file_selector_windows
|
||||
sha256: "62197474ae75893a62df75939c777763d39c2bc5f73ce5b88497208bc269abfd"
|
||||
sha256: fbefc5fb92c6d3cbe8d284a2cd971b593bb07d2cd6da8557b81a862250b4acec
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.3+5"
|
||||
version: "0.9.3+6"
|
||||
firebase_core:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_core
|
||||
sha256: d2625088d8f8836a7a74a7eb94a5372d70ad88382602ba2dcc02805c294d0d16
|
||||
sha256: "5fbbaa2aeb08a52feee559f92a62f5a6b04c9bdff81c8f608636771cf0d7b680"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.11.0"
|
||||
version: "4.15.0"
|
||||
firebase_core_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_core_platform_interface
|
||||
sha256: "913e7c96ef83a80ad7e1c3f8a059167b3de23b5d5e07fa3ed8f11abe24de98b6"
|
||||
sha256: "9bfbc85faca09346471ac56fbcee00757ebcfd85887c6f602764eff0001902d8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.1.0"
|
||||
version: "8.1.1"
|
||||
firebase_core_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_core_web
|
||||
sha256: "30ba3ae56f5beb2cea836033201570612c911661889f815eca73b6056c7b55bf"
|
||||
sha256: "8ed84f5001dbd7a0390e2818d46bc858ceebb970edededdfc8d6552c76fc2f6e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.9.0"
|
||||
version: "3.12.0"
|
||||
firebase_messaging:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_messaging
|
||||
sha256: ce21a510e5a9aed67a0404476981e19ec0361a0301eeba547dc93dc2e7dec99a
|
||||
sha256: "47a8142a0b897783103b01018ad69f123b819b0120483847bde30d1b2fa89b36"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "16.4.1"
|
||||
version: "16.7.0"
|
||||
firebase_messaging_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_messaging_platform_interface
|
||||
sha256: e10f6d521e7ed663d0ea2f4ec7de4c6729f8c2ce25d32faf6d6b4219da8515c2
|
||||
sha256: f9707e185b8ce1155d58e7e29348245072d99981f899fa8d3214abb2652c4ccb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.9.0"
|
||||
version: "4.10.0"
|
||||
firebase_messaging_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_messaging_web
|
||||
sha256: "7ab45dfaf8efcd1a769baa9b8debbd0da281f5d3fc07274296b564396a980292"
|
||||
sha256: "311b16c75fc645c7a70c9ade38908abb12310dfce449fc3d3cee1771f196351e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.1"
|
||||
version: "4.2.5"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -425,42 +417,42 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: functions_client
|
||||
sha256: e9685e9ab852a8b8e0579c867f6c9155da27317b294b3df796a536b8b8e0d253
|
||||
sha256: "931e822688d2e97867b2300e2fdbb08c9db73f8653fc83efc7a259d2e0cca769"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.6.4"
|
||||
version: "2.7.1"
|
||||
get_it:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: get_it
|
||||
sha256: "568d62f0e68666fb5d95519743b3c24a34c7f19d834b0658c46e26d778461f66"
|
||||
sha256: "2b5c6b077aad30bba9782178baff6076a2044141f1d5f2f15b43bca3fbe74874"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.2.1"
|
||||
version: "9.3.0"
|
||||
go_router:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: go_router
|
||||
sha256: "5922b2861e2235a3504896f0d6fa07d84141b480cf52eecd2f42cd25585a9e8a"
|
||||
sha256: d7a3576cb312649eaa51f2356450aed686085fb58fcdebda5b359aa951eef7ea
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "17.3.0"
|
||||
version: "17.5.0"
|
||||
google_fonts:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: google_fonts
|
||||
sha256: "4e9391085e524954a51e3625b7c9c7e9851dc3f376603208bb45c24b9a66255d"
|
||||
sha256: e3cb3ee6b47fd2472c23de6da5744796a4da195137759ddb3fbcc9467b7b3c7d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.1.0"
|
||||
version: "8.2.1"
|
||||
gotrue:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: gotrue
|
||||
sha256: "360bba9606e58d5acc59a033ab64ae3cf571a6868f7a7267cb8e9a204b7bf1b2"
|
||||
sha256: cd73a6de4198baca71341177bed233673d7965aca2a0257ab5561feb2abdaf59
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.26.0"
|
||||
version: "2.27.2"
|
||||
gtk:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -469,22 +461,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
hooks:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: hooks
|
||||
sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: html
|
||||
sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602"
|
||||
sha256: "43b67b8f43321ab066817dfac5619596c98bb1b61624e77203bb4351785f9699"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.15.6"
|
||||
version: "0.15.7"
|
||||
http:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -505,10 +489,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image
|
||||
sha256: "6300175e00616bbc832e2fc91bfa4d776af5402c81c7151bee6905bb08473c52"
|
||||
sha256: a1e7f4951e538a568e14b856702afc9ae1d2f4b202daced8d22c1b9cd211ce89
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.9.1"
|
||||
version: "4.10.1"
|
||||
image_picker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -521,10 +505,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_android
|
||||
sha256: "6f3a1995eafb000333174fae92202622033b0ee7fd917a6cd3730295264df84a"
|
||||
sha256: "8a7823d5d3e884f7780829d85d92110d072bdcd9ed48e2be158d2abe91a912d4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.13+19"
|
||||
version: "0.8.13+25"
|
||||
image_picker_for_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -537,10 +521,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_ios
|
||||
sha256: b9c4a438a9ff4f60808c9cf0039b93a42bb6c2211ef6ebb647394b2b3fa84588
|
||||
sha256: "815921d05ef87d64dc64e9f7f855967614a9a67086d0c60fa27d47a1cd9a8896"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.13+6"
|
||||
version: "0.8.13+9"
|
||||
image_picker_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -585,26 +569,34 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: intl
|
||||
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
|
||||
sha256: "1ca20c894b1717686a2319b8548763d812bc0aabdac580420a44c5178c57a867"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.20.2"
|
||||
version: "0.20.3"
|
||||
jni:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: jni
|
||||
sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f
|
||||
sha256: "6b9ca0602fef0230e83149afbe3f9f8227e94f2bbe84a1da4f14d699742f402d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.1.0"
|
||||
jni_flutter:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: jni_flutter
|
||||
sha256: "8b59e590786050b1cd866677dddaf76b1ade5e7bc751abe04b86e84d379d3ba6"
|
||||
sha256: b2310cdd4c18c65c081ab141a41efa94aa26c65431803703ece51996f174f351
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "1.0.3"
|
||||
jni_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: jni_util
|
||||
sha256: "1ba86da04a5f2bf18fde2edb235587e70c5b0fc5bd4ba955f46b00942c3fc35f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
json_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -613,14 +605,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.12.0"
|
||||
jwt_decode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: jwt_decode
|
||||
sha256: d2e9f68c052b2225130977429d30f187aa1981d789c76ad104a32243cfdebfbb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.1"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -665,10 +649,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
|
||||
sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.19"
|
||||
version: "0.12.20"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -681,18 +665,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
|
||||
sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.18.0"
|
||||
version: "1.19.0"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: mime
|
||||
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
|
||||
sha256: bd47de35f07e27267e69c8c8b22edf9473bfee170a60d60fcc93730c5144b7f6
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
version: "2.1.0"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -701,22 +685,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
objective_c:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: objective_c
|
||||
sha256: "6cb691c686fa2838c6deb34980d426145c2a5d537491cb83d463c33cdbc726ed"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.4.1"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc
|
||||
sha256: ffcf4cf3d6c0b74ac43708d9f56625506e8a68aa935abe9d267a7330f320eb5d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "3.0.0"
|
||||
package_info_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -737,10 +713,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: passkeys_platform_interface
|
||||
sha256: "9610bd136b3382500390912ddd8517ee99505228b1af7b507b9c907f7e99a47d"
|
||||
sha256: "5fca044a6f1a3c5abff645ca5a5417b613c130d1c4e08513ba9182c7f4834619"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.8.0"
|
||||
version: "2.10.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -774,13 +750,13 @@ packages:
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
path_provider_foundation:
|
||||
dependency: transitive
|
||||
dependency: "direct overridden"
|
||||
description:
|
||||
name: path_provider_foundation
|
||||
sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699"
|
||||
sha256: "6d13aece7b3f5c5a9731eaf553ff9dcbc2eff41087fd2df587fd0fed9a3eb0c4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.6.0"
|
||||
version: "2.5.1"
|
||||
path_provider_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -809,10 +785,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: pdf
|
||||
sha256: "517df47af468734a23c8b513c0c6a8a62357403ab1b8ab7fad1606576a9dbdd0"
|
||||
sha256: "6e40827f370d196e97c6611724d923a3d86c431ce8e2ce1e59edd03a67a1a6e6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.13.0"
|
||||
version: "3.13.1"
|
||||
pdf_widget_wrapper:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -826,10 +802,10 @@ packages:
|
||||
description:
|
||||
path: "packages/pdfx"
|
||||
ref: main
|
||||
resolved-ref: "900ad0799ebd12d6c87189275fcb6155ce8a9374"
|
||||
resolved-ref: "452979e49fa00df9d964422ff1bc9f1f6b122d16"
|
||||
url: "https://github.com/ScerIO/packages.flutter.git"
|
||||
source: git
|
||||
version: "2.9.2"
|
||||
version: "2.11.0"
|
||||
permission_handler:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -850,42 +826,42 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_apple
|
||||
sha256: "79dfa1df734798aa3cfdad166d3a3698c206d8813de13516ea1071b5d7e2f420"
|
||||
sha256: "066bbbc60031b63b916a3871e7bb4b6a8c5e7cec8146dafec53d1da304eff0a5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.4.10"
|
||||
version: "9.6.2"
|
||||
permission_handler_html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_html
|
||||
sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24"
|
||||
sha256: "6ea98b3f17f60d3b527f2647ed2ab4dc0f6bfe25b22cb1c363f5d8f62252f6ac"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.3+5"
|
||||
version: "0.1.4+1"
|
||||
permission_handler_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_platform_interface
|
||||
sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878
|
||||
sha256: ed86a61c190258fdd65de395ea0632822e3415c1faec38eae0c31b479c28a531
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.3.0"
|
||||
version: "4.4.1"
|
||||
permission_handler_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_windows
|
||||
sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
|
||||
sha256: caeae01858a0a7d2df67a445ac98e1ad95e55a0e77c73044f4e9b1c8c2289cbd
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.1"
|
||||
version: "0.2.2"
|
||||
petitparser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: petitparser
|
||||
sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675"
|
||||
sha256: "2f1564aadb14215e478563b5406cb80729d022158c01dc50c96013c2f7eb4790"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.2"
|
||||
version: "7.1.0"
|
||||
photo_view:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -898,10 +874,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: platform
|
||||
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
|
||||
sha256: a36d119c13416516a7b5913fbe8af8531e11633d784c550b2125f76c758524ec
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.6"
|
||||
version: "3.2.0"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -922,26 +898,26 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: posix
|
||||
sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07"
|
||||
sha256: bc1bad54ad2b735816e31f8d4600cfde6c7839975085ddfbca48b6c9f7c4044e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.5.0"
|
||||
version: "6.5.2"
|
||||
postgrest:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: postgrest
|
||||
sha256: "10e3f195e131eec944fa872644aed89b33b5be998f3fc77c87325db3927bc646"
|
||||
sha256: b7f957273ba6a1c26cefa987ac524f4138e9ab7542fbb9e6abdfddacb9895a21
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.8.0"
|
||||
version: "2.9.1"
|
||||
printing:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: printing
|
||||
sha256: f6cd14c768c1352dd37a958a3ee351aa9ce305b398218d3acd86389d5f7ecad1
|
||||
sha256: "0f72f29f2e08b8453b7a45b6c7781eb792b1da3468bf0910be0eb3b1d6781f49"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.15.0"
|
||||
version: "5.15.1"
|
||||
provider:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -950,14 +926,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.5+1"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
qr:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -978,34 +946,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: realtime_client
|
||||
sha256: "0cfbe0047e2591eba348938e9b4e620d5b1a8df6c374757e8eb8645252b8387f"
|
||||
sha256: ff731ce21fd775e0d7accfb1eaccdcf47b687610720822ba8b9fd8f5bccb2bd9
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.11.0"
|
||||
record_use:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: record_use
|
||||
sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.0"
|
||||
retry:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: retry
|
||||
sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
rxdart:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: rxdart
|
||||
sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.28.0"
|
||||
version: "2.13.0"
|
||||
shared_preferences:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -1018,18 +962,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_android
|
||||
sha256: "93ae5884a9df5d3bb696825bceb3a17590754548b5d740eba51500afc8d088f5"
|
||||
sha256: "1e12aafe408aa50da80edfd679a2a6bf63ba7ab37c7fa98286da459a757b3399"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.26"
|
||||
version: "2.4.28"
|
||||
shared_preferences_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_foundation
|
||||
sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f"
|
||||
sha256: "2ec3934efa51e46117f23031cc141b8fc878e8525b94ec1ea4f7f586cf1b47ea"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.5.6"
|
||||
version: "2.5.7"
|
||||
shared_preferences_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1079,18 +1023,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
||||
sha256: "277654b3034d17ac6f9f1cb5595db011b1d5d41e8806866db28e0abaa101c490"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.12.1"
|
||||
version: "1.12.2"
|
||||
storage_client:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: storage_client
|
||||
sha256: "221263cfbe0c01575b7d7fe7543e44abff380eb4d38d936372844a1caa85ba12"
|
||||
sha256: b951281b8e2b293460f0e6cc4e866f2546681390f0e37d24fbbd7b4a0deb27a3
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.6.0"
|
||||
version: "2.8.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1111,26 +1055,34 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: supabase
|
||||
sha256: "3879996256325fcc9abb03b62b12c07e4eaae2e008e1bf043cc1525184159a43"
|
||||
sha256: "3662449640972335e50d075a1fceb000b9217e403564305d129a4d287ff4b4c9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.14.0"
|
||||
version: "2.16.2"
|
||||
supabase_common:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: supabase_common
|
||||
sha256: a7961a44953cf8d9da049381fc3377516348255042fbb12b9d4f8540816f2fe9
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.2"
|
||||
supabase_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: supabase_flutter
|
||||
sha256: c9916c1cd512ebf3107ec0f83c9dca13d2e1e789629c2a5df896586bff46ce5f
|
||||
sha256: "9698f61e83907b939fd6ee6bbf833d8456541e29cb38e9c08e52ebf88fa9faf4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.16.0"
|
||||
version: "2.18.0"
|
||||
synchronized:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: synchronized
|
||||
sha256: "93b153dcb6a26dcddee6ca087dd634b53e38c10b5aa163e8e49501a776456153"
|
||||
sha256: "397b146f97613b83d84bdccb439bc8d0f3aebb6c1d14a9641e6f24201c490b2d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.4.1"
|
||||
version: "3.4.2"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1143,10 +1095,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
|
||||
sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.11"
|
||||
version: "0.7.12"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1191,42 +1143,42 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: url_launcher
|
||||
sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8
|
||||
sha256: e8cc955c97e06df9879140a1fe301f3d493f01b7c62dec7f46834be31d7e9fda
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.3.2"
|
||||
version: "6.3.3"
|
||||
url_launcher_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_android
|
||||
sha256: b413d49b73867ac08dd2f9890efd3cc11f2a0e577618d50843440a1fb3776c32
|
||||
sha256: "611e87fb320b70d1dd721dc46af89c98aceccea9b31fde49e084591414e0c610"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.3.32"
|
||||
version: "6.3.33"
|
||||
url_launcher_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_ios
|
||||
sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0"
|
||||
sha256: "8faa1aab294f1ab4040b43660c887b0418d5fa4f0cffef76a484e6aa1092eb4a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.4.1"
|
||||
version: "6.4.2"
|
||||
url_launcher_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_linux
|
||||
sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a
|
||||
sha256: "10f86fef4c2c43563fa6c211ff9cf757adf4d3ab762c56bd430664a947d70cd0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.2"
|
||||
version: "3.2.3"
|
||||
url_launcher_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_macos
|
||||
sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18"
|
||||
sha256: "5e835a3b869c2d70325349c81c5a45c28e20791265b67b2669da6b08c5cd5201"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.5"
|
||||
version: "3.2.6"
|
||||
url_launcher_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1247,26 +1199,26 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_windows
|
||||
sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f"
|
||||
sha256: "6c5ad3f22cd4c38e089b81963b3cd7bb83b111b2df5dce008bb066162f42e429"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.5"
|
||||
version: "3.1.6"
|
||||
uuid:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: uuid
|
||||
sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489"
|
||||
sha256: "9b129329f58692f6e6578329498a8fe9fbe98f090beb764ffbb8ee2eadd01dcd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.5.3"
|
||||
version: "4.6.0"
|
||||
vector_graphics:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_graphics
|
||||
sha256: "2306c03da2ba81724afeb589c351ebbc0aa7d86005925be8f8735856dbe5e42d"
|
||||
sha256: "9d0e3b9cb16542ad660daee871e726a10d13a93b7b5391677c3160e8f5e83935"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.2"
|
||||
version: "1.2.3"
|
||||
vector_graphics_codec:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1279,26 +1231,26 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_graphics_compiler
|
||||
sha256: "142a9146f447d15b10bdc00e21d5f4d83e5b32bb5f8f8f5a04c75311344923a3"
|
||||
sha256: "4dca4feb77dc3ec7f6e27e49c53241eb8217f55e4f9b12599a27f8903bca5682"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.6"
|
||||
version: "1.3.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
|
||||
sha256: "92b9910f66ed1057fd4da7b040ae7c74cafacf885bdc81be496928d5049b032d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.4.3"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360"
|
||||
sha256: "5f37239c4851efcef929cea7824e76df7f2f0970aef85d66bbc430afa40e72f0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "15.2.0"
|
||||
version: "15.3.0"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1351,10 +1303,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
|
||||
sha256: f67cdd8e07d3c6329146aaef1ba043542b3134c12489f553ca9a7435d1068aea
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.3"
|
||||
version: "3.1.4"
|
||||
yet_another_json_isolate:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1364,5 +1316,5 @@ packages:
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
sdks:
|
||||
dart: ">=3.12.0 <4.0.0"
|
||||
dart: ">=3.13.0 <4.0.0"
|
||||
flutter: ">=3.44.0"
|
||||
+2
-1
@@ -1,7 +1,7 @@
|
||||
name: flux
|
||||
description: "Gestione attività negozio di telefonia"
|
||||
publish_to: 'none'
|
||||
version: 1.3.2+48
|
||||
version: 2.0.15+71
|
||||
|
||||
environment:
|
||||
sdk: ^3.11.3
|
||||
@@ -49,6 +49,7 @@ dependency_overrides:
|
||||
url: https://github.com/ScerIO/packages.flutter.git
|
||||
ref: main
|
||||
path: packages/pdfx
|
||||
path_provider_foundation: 2.5.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:flux/core/utils/working_days_helper.dart';
|
||||
|
||||
void main() {
|
||||
group('WorkingDaysHelper Tests', () {
|
||||
test('Identifica correttamente domeniche e festività italiane', () {
|
||||
// 1 Gennaio (Capodanno)
|
||||
expect(WorkingDaysHelper.isWorkingDay(DateTime(2026, 1, 1)), isFalse);
|
||||
|
||||
// 6 Gennaio (Epifania)
|
||||
expect(WorkingDaysHelper.isWorkingDay(DateTime(2026, 1, 6)), isFalse);
|
||||
|
||||
// 25 Aprile (Liberazione)
|
||||
expect(WorkingDaysHelper.isWorkingDay(DateTime(2026, 4, 25)), isFalse);
|
||||
|
||||
// 1 Maggio (Festa Lavoratori)
|
||||
expect(WorkingDaysHelper.isWorkingDay(DateTime(2026, 5, 1)), isFalse);
|
||||
|
||||
// 2 Giugno (Festa Repubblica)
|
||||
expect(WorkingDaysHelper.isWorkingDay(DateTime(2026, 6, 2)), isFalse);
|
||||
|
||||
// 15 Agosto (Ferragosto)
|
||||
expect(WorkingDaysHelper.isWorkingDay(DateTime(2026, 8, 15)), isFalse);
|
||||
|
||||
// Domenica qualunque (es. 13 Settembre 2026)
|
||||
final sunday = DateTime(2026, 9, 13);
|
||||
expect(sunday.weekday, equals(DateTime.sunday));
|
||||
expect(WorkingDaysHelper.isWorkingDay(sunday), isFalse);
|
||||
|
||||
// Lunedì normale lavorativo (es. 14 Settembre 2026)
|
||||
final monday = DateTime(2026, 9, 14);
|
||||
expect(monday.weekday, equals(DateTime.monday));
|
||||
expect(WorkingDaysHelper.isWorkingDay(monday), isTrue);
|
||||
|
||||
// Sabato (giorno lavorativo nei negozi di telefonia/energia)
|
||||
final saturday = DateTime(2026, 9, 12);
|
||||
expect(saturday.weekday, equals(DateTime.saturday));
|
||||
expect(WorkingDaysHelper.isWorkingDay(saturday), isTrue);
|
||||
});
|
||||
|
||||
test('Calcolo Pasquetta (Lunedì dell\'Angelo)', () {
|
||||
// Nel 2026 Pasqua è il 5 Aprile, Pasquetta è il 6 Aprile
|
||||
final easterMonday2026 = WorkingDaysHelper.calculateEasterMonday(2026);
|
||||
expect(easterMonday2026.month, equals(4));
|
||||
expect(easterMonday2026.day, equals(6));
|
||||
expect(WorkingDaysHelper.isWorkingDay(DateTime(2026, 4, 6)), isFalse);
|
||||
});
|
||||
|
||||
test('Calcolo giorni lavorativi periodo escludendo domeniche', () {
|
||||
// Settembre 2026: dal 1 al 30
|
||||
// Totale 30 giorni, 4 domeniche (6, 13, 20, 27) = 26 giorni lavorativi
|
||||
final septStart = DateTime(2026, 9, 1);
|
||||
final septEnd = DateTime(2026, 9, 30);
|
||||
|
||||
final period = WorkingDaysHelper.calculateWorkingDaysPeriod(
|
||||
start: septStart,
|
||||
end: septEnd,
|
||||
now: DateTime(2026, 9, 10),
|
||||
);
|
||||
|
||||
expect(period.total, equals(26));
|
||||
// Dal 1 al 10 settembre: 10 giorni meno 1 domenica (6 sett) = 9 giorni lavorativi trascorsi
|
||||
expect(period.elapsed, equals(9));
|
||||
// Dal 10 al 30 settembre (10 compreso): 21 giorni meno 3 domeniche (13, 20, 27) = 18 giorni rimanenti
|
||||
expect(period.remaining, equals(18));
|
||||
});
|
||||
});
|
||||
}
|
||||
+7
-6
@@ -16,11 +16,12 @@ Compression=lzma2/max
|
||||
SolidCompression=yes
|
||||
WizardStyle=modern
|
||||
|
||||
; Icona dell'installer (opzionale, decommenta se hai il file .ico)
|
||||
; Icona dell'installer
|
||||
SetupIconFile=windows\runner\resources\app_icon.ico
|
||||
|
||||
; Richiede privilegi di amministratore per installare nella cartella Programmi
|
||||
PrivilegesRequired=admin
|
||||
; Installazione utente (senza richiesta di privilegi amministratore UAC)
|
||||
PrivilegesRequired=lowest
|
||||
CloseApplications=force
|
||||
|
||||
[Files]
|
||||
; 1. L'eseguibile principale di Flutter
|
||||
@@ -31,12 +32,12 @@ Source: "build\windows\x64\runner\Release\*"; DestDir: "{app}"; Flags: ignorever
|
||||
|
||||
[Icons]
|
||||
; Scorciatoie nel menu Start e sul Desktop
|
||||
Name: "{autoprograms}\LaMiaApp"; Filename: "{app}\Flux.exe"
|
||||
Name: "{autodesktop}\LaMiaApp"; Filename: "{app}\Flux.exe"; Tasks: desktopicon
|
||||
Name: "{autoprograms}\Flux"; Filename: "{app}\Flux.exe"
|
||||
Name: "{autodesktop}\Flux"; Filename: "{app}\Flux.exe"; Tasks: desktopicon
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "Crea un'icona sul &Desktop"; GroupDescription: "Icone aggiuntive:"; Flags: unchecked
|
||||
|
||||
[Run]
|
||||
; Opzione per avviare l'app subito dopo la fine dell'installazione
|
||||
Filename: "{app}\Flux.exe"; Description: "Avvia LaMiaApp"; Flags: nowait postinstall skipifsilent
|
||||
Filename: "{app}\Flux.exe"; Description: "Avvia Flux"; Flags: nowait postinstall
|
||||
Reference in new issue
Block a user