Auto-sync: 20260424_230000
This commit is contained in:
parent
7a295031fa
commit
a8e97047e4
29 changed files with 2291 additions and 1117 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
12
.agent/skills/memory-bank-protocol/SKILL.md
Normal file
12
.agent/skills/memory-bank-protocol/SKILL.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Memory Bank Protocol
|
||||
|
||||
## Regola d'oro
|
||||
Prima di proporre nuove modifiche o analizzare bug, **devi sempre consultare la memory bank**.
|
||||
|
||||
## Azioni Obbligatorie
|
||||
1. **Lettura preventiva**: Leggi `current-state.md`, `change-log.md` e `decisions.md` nella cartella `memory-bank/` per avere il contesto aggiornato sulle priorità e decisioni architetturali.
|
||||
2. **Dichiarazione Esplicita**: Inizia il tuo thought process o la tua risposta confermando esplicitamente: "Storico controllato: [file letti + rilevanti]".
|
||||
3. **Aggiornamento Continuo**: Dopo ogni modifica significativa al codice, aggiorna immediatamente i file della memory bank (`change-log.md` e `current-state.md`).
|
||||
4. **Stile Documentazione**: I file devono rimanere rigorosamente in formato Markdown, scritti in modo conciso e datati.
|
||||
|
||||
**Nota Bene**: Sei autorizzato a leggere e scrivere liberamente nei file della memory bank in qualsiasi momento tramite il tool `write_to_file` o di sostituzione del contenuto. Non devi chiedere all'utente i permessi per mantenere aggiornata la documentazione.
|
||||
501
flutter_analyze.txt
Normal file
501
flutter_analyze.txt
Normal file
|
|
@ -0,0 +1,501 @@
|
|||
Resolving dependencies...
|
||||
Downloading packages...
|
||||
_flutterfire_internals 1.3.59 (1.3.69 available)
|
||||
archive 4.0.7 (4.0.9 available)
|
||||
async 2.13.0 (2.13.1 available)
|
||||
camera 0.11.3+1 (0.12.0+1 available)
|
||||
camera_android_camerax 0.6.30 (0.7.2 available)
|
||||
camera_avfoundation 0.9.23+2 (0.10.1 available)
|
||||
camera_platform_interface 2.12.0 (2.13.0 available)
|
||||
characters 1.4.0 (1.4.1 available)
|
||||
cli_util 0.4.2 (0.5.0 available)
|
||||
cloud_firestore 5.6.12 (6.3.0 available)
|
||||
cloud_firestore_platform_interface 6.6.12 (7.2.0 available)
|
||||
cloud_firestore_web 4.4.12 (5.3.0 available)
|
||||
device_info_plus 12.3.0 (13.1.0 available)
|
||||
device_info_plus_platform_interface 7.0.3 (8.1.0 available)
|
||||
facebook_app_events 0.24.0 (0.27.1 available)
|
||||
ffi 2.1.5 (2.2.0 available)
|
||||
firebase_auth 5.7.0 (6.4.0 available)
|
||||
firebase_auth_platform_interface 7.7.3 (8.1.9 available)
|
||||
firebase_auth_web 5.15.3 (6.1.5 available)
|
||||
firebase_core 3.15.2 (4.7.0 available)
|
||||
firebase_core_platform_interface 6.0.2 (6.0.3 available)
|
||||
firebase_core_web 2.24.1 (3.6.0 available)
|
||||
firebase_database 11.3.10 (12.3.0 available)
|
||||
firebase_database_platform_interface 0.2.6+10 (0.3.1+1 available)
|
||||
firebase_database_web 0.2.6+16 (0.2.7+6 available)
|
||||
flutter_email_sender 6.0.3 (8.0.0 available)
|
||||
flutter_launcher_icons 0.13.1 (0.14.4 available)
|
||||
flutter_plugin_android_lifecycle 2.0.33 (2.0.34 available)
|
||||
flutter_svg 2.2.3 (2.2.4 available)
|
||||
geocoding_android 4.0.1 (5.0.1 available)
|
||||
geocoding_platform_interface 3.2.0 (5.0.0 available)
|
||||
google_mlkit_barcode_scanning 0.13.0 (0.14.2 available)
|
||||
google_mlkit_commons 0.9.0 (0.11.1 available)
|
||||
google_mlkit_text_recognition 0.14.0 (0.15.1 available)
|
||||
hooks 1.0.1 (1.0.3 available)
|
||||
image 4.5.4 (4.8.0 available)
|
||||
js 0.6.7 (0.7.2 available)
|
||||
json_annotation 4.10.0 (4.11.0 available)
|
||||
matcher 0.12.17 (0.12.19 available)
|
||||
material_color_utilities 0.11.1 (0.13.0 available)
|
||||
meta 1.17.0 (1.18.2 available)
|
||||
mime 1.0.6 (2.0.0 available)
|
||||
mobile_scanner 6.0.11 (7.2.0 available)
|
||||
native_toolchain_c 0.17.4 (0.18.0 available)
|
||||
package_info_plus 9.0.0 (10.1.0 available)
|
||||
package_info_plus_platform_interface 3.2.1 (4.1.0 available)
|
||||
path_provider_android 2.2.22 (2.3.1 available)
|
||||
pdf 3.11.3 (3.12.0 available)
|
||||
permission_handler 11.4.0 (12.0.1 available)
|
||||
permission_handler_android 12.1.0 (13.0.1 available)
|
||||
petitparser 7.0.1 (7.0.2 available)
|
||||
pointycastle 3.9.1 (4.0.0 available)
|
||||
posix 6.0.3 (6.5.0 available)
|
||||
printing 5.14.2 (5.14.3 available)
|
||||
share_plus 7.2.2 (13.1.0 available)
|
||||
share_plus_platform_interface 3.4.0 (7.1.0 available)
|
||||
shared_preferences 2.5.4 (2.5.5 available)
|
||||
shared_preferences_android 2.4.21 (2.4.23 available)
|
||||
shared_preferences_platform_interface 2.4.1 (2.4.2 available)
|
||||
syncfusion_flutter_core 32.2.3 (33.2.3 available)
|
||||
syncfusion_flutter_pdf 32.2.3 (33.2.3 available)
|
||||
syncfusion_flutter_pdfviewer 32.2.3 (33.2.3 available)
|
||||
syncfusion_flutter_signaturepad 32.2.3 (33.2.3 available)
|
||||
syncfusion_pdfviewer_linux 32.2.3 (33.2.3 available)
|
||||
syncfusion_pdfviewer_macos 32.2.3 (33.2.3 available)
|
||||
syncfusion_pdfviewer_platform_interface 32.2.3 (33.2.3 available)
|
||||
syncfusion_pdfviewer_web 32.2.3 (33.2.3 available)
|
||||
syncfusion_pdfviewer_windows 32.2.3 (33.2.3 available)
|
||||
test_api 0.7.7 (0.7.11 available)
|
||||
url_launcher_android 6.3.28 (6.3.29 available)
|
||||
url_launcher_ios 6.4.0 (6.4.1 available)
|
||||
uuid 4.5.2 (4.5.3 available)
|
||||
vector_graphics 1.1.19 (1.1.21 available)
|
||||
vector_graphics_compiler 1.1.20 (1.2.0 available)
|
||||
vector_math 2.2.0 (2.3.0 available)
|
||||
vm_service 15.0.2 (15.1.0 available)
|
||||
webview_flutter_android 4.10.11 (4.11.0 available)
|
||||
webview_flutter_platform_interface 2.14.0 (2.15.1 available)
|
||||
webview_flutter_wkwebview 3.23.6 (3.24.5 available)
|
||||
win32 5.15.0 (6.1.0 available)
|
||||
win32_registry 2.1.0 (3.0.3 available)
|
||||
Got dependencies!
|
||||
81 packages have newer versions incompatible with dependency constraints.
|
||||
Try `flutter pub outdated` for more information.
|
||||
Analyzing cid_app...
|
||||
|
||||
info • Don't invoke 'print' in production code • lib/build_cai_app.dart:4:3 • avoid_print
|
||||
info • Don't invoke 'print' in production code • lib/build_cai_app.dart:16:5 • avoid_print
|
||||
info • Don't invoke 'print' in production code • lib/build_cai_app.dart:44:5 • avoid_print
|
||||
info • Don't invoke 'print' in production code • lib/build_cai_app.dart:45:5 • avoid_print
|
||||
info • Don't invoke 'print' in production code • lib/build_cai_app.dart:47:5 • avoid_print
|
||||
info • The constant name 'feriti_NO' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:90:23 • constant_identifier_names
|
||||
info • The constant name 'feriti_SI' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:91:23 • constant_identifier_names
|
||||
info • The constant name 'danni_veicoli_NO' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:92:23 • constant_identifier_names
|
||||
info • The constant name 'danni_veicoli_SI' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:93:23 • constant_identifier_names
|
||||
info • The constant name 'danni_oggetti_NO' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:94:23 • constant_identifier_names
|
||||
info • The constant name 'danni_oggetti_SI' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:95:23 • constant_identifier_names
|
||||
info • The constant name 'danni_mat_A_NO' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:96:23 • constant_identifier_names
|
||||
info • The constant name 'danni_mat_A_SI' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:97:23 • constant_identifier_names
|
||||
info • The constant name 'danni_mat_B_NO' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:98:23 • constant_identifier_names
|
||||
info • The constant name 'danni_mat_B_SI' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:99:23 • constant_identifier_names
|
||||
info • The constant name 'tot_crocette_A' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:115:23 • constant_identifier_names
|
||||
info • The constant name 'tot_crocette_B' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:116:23 • constant_identifier_names
|
||||
info • The constant name 'box_grafico' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:119:23 • constant_identifier_names
|
||||
info • The constant name 'box_firma_A' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:120:23 • constant_identifier_names
|
||||
info • The constant name 'box_firma_B' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:121:23 • constant_identifier_names
|
||||
info • The constant name 'box_urto_A' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:124:23 • constant_identifier_names
|
||||
info • The constant name 'box_urto_B' isn't a lowerCamelCase identifier • lib/cai_mapping.dart:125:23 • constant_identifier_names
|
||||
info • 'desiredAccuracy' is deprecated and shouldn't be used. use settings parameter with AndroidSettings, AppleSettings, WebSettings, or LocationSettings • lib/carro_attr.dart:84:13 • deprecated_member_use
|
||||
info • 'timeLimit' is deprecated and shouldn't be used. use settings parameter with AndroidSettings, AppleSettings, WebSettings, or LocationSettings • lib/carro_attr.dart:85:13 • deprecated_member_use
|
||||
warning • The '!' will have no effect because the receiver can't be null • lib/carro_attr.dart:134:25 • unnecessary_non_null_assertion
|
||||
info • Statements in an if should be enclosed in a block • lib/cid_data_manager.dart:127:30 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/cid_data_manager.dart:128:12 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/cid_data_manager.dart:136:30 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/cid_data_manager.dart:137:12 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/cid_data_manager.dart:152:30 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/cid_data_manager.dart:152:57 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/cid_data_manager.dart:156:30 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/cid_data_manager.dart:156:54 • curly_braces_in_flow_control_structures
|
||||
info • The file name 'comp_1-5.dart' isn't a lower_case_with_underscores identifier • lib/comp_1-5.dart:1:1 • file_names
|
||||
info • The type name 'Comp1_5Screen' isn't an UpperCamelCase identifier • lib/comp_1-5.dart:24:7 • camel_case_types
|
||||
info • Invalid use of a private type in a public API • lib/comp_1-5.dart:28:3 • library_private_types_in_public_api
|
||||
info • The type name '_Comp1_5ScreenState' isn't an UpperCamelCase identifier • lib/comp_1-5.dart:31:7 • camel_case_types
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_1-5.dart:94:34 • deprecated_member_use
|
||||
info • 'desiredAccuracy' is deprecated and shouldn't be used. use settings parameter with AndroidSettings, AppleSettings, WebSettings, or LocationSettings • lib/comp_1-5.dart:209:11 • deprecated_member_use
|
||||
info • 'activeColor' is deprecated and shouldn't be used. Use activeThumbColor instead. This feature was deprecated after v3.31.0-2.0.pre • lib/comp_1-5.dart:426:15 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_1-5.dart:427:45 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_1-5.dart:467:137 • deprecated_member_use
|
||||
info • Invalid use of a private type in a public API • lib/comp_10.dart:10:3 • library_private_types_in_public_api
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_10.dart:49:34 • deprecated_member_use
|
||||
info • Invalid use of a private type in a public API • lib/comp_12.dart:11:3 • library_private_types_in_public_api
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_12.dart:62:34 • deprecated_member_use
|
||||
info • Unnecessary braces in a string interpolation • lib/comp_12.dart:222:40 • unnecessary_brace_in_string_interps
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_13.dart:300:37 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_13.dart:349:47 • deprecated_member_use
|
||||
info • Statements in a for should be enclosed in a block • lib/comp_13.dart:380:33 • curly_braces_in_flow_control_structures
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_13.dart:449:50 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_13.dart:508:50 • deprecated_member_use
|
||||
info • The import of 'dart:typed_data' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/services.dart' • lib/comp_16.dart:3:8 • unnecessary_import
|
||||
info • The private field _staCancellando could be 'final' • lib/comp_16.dart:32:8 • prefer_final_fields
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_16.dart:63:34 • deprecated_member_use
|
||||
info • Statements in an if should be enclosed in a block • lib/comp_16.dart:141:43 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/comp_16.dart:141:69 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/comp_16.dart:321:41 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/comp_16.dart:321:67 • curly_braces_in_flow_control_structures
|
||||
info • Don't use 'BuildContext's across async gaps, guarded by an unrelated 'mounted' check • lib/comp_16.dart:464:30 • use_build_context_synchronously
|
||||
info • Don't use 'BuildContext's across async gaps, guarded by an unrelated 'mounted' check • lib/comp_16.dart:465:27 • use_build_context_synchronously
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_16.dart:511:37 • deprecated_member_use
|
||||
info • 'onPopInvoked' is deprecated and shouldn't be used. Use onPopInvokedWithResult instead. This feature was deprecated after v3.22.0-12.0.pre • lib/comp_16.dart:518:9 • deprecated_member_use
|
||||
info • Statements in an if should be enclosed in a block • lib/comp_16.dart:520:31 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/comp_16.dart:520:54 • curly_braces_in_flow_control_structures
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_16.dart:528:51 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_16.dart:555:51 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_16.dart:590:56 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_16.dart:612:55 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_16.dart:612:207 • deprecated_member_use
|
||||
info • Don't use 'BuildContext's across async gaps • lib/comp_16.dart:646:21 • use_build_context_synchronously
|
||||
info • The file name 'comp_6-7.dart' isn't a lower_case_with_underscores identifier • lib/comp_6-7.dart:1:1 • file_names
|
||||
info • The type name 'Comp6_7Screen' isn't an UpperCamelCase identifier • lib/comp_6-7.dart:19:7 • camel_case_types
|
||||
info • Invalid use of a private type in a public API • lib/comp_6-7.dart:23:3 • library_private_types_in_public_api
|
||||
info • The type name '_Comp6_7ScreenState' isn't an UpperCamelCase identifier • lib/comp_6-7.dart:26:7 • camel_case_types
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_6-7.dart:252:34 • deprecated_member_use
|
||||
info • Use interpolation to compose strings and values • lib/comp_6-7.dart:320:26 • prefer_interpolation_to_compose_strings
|
||||
info • Use interpolation to compose strings and values • lib/comp_6-7.dart:331:28 • prefer_interpolation_to_compose_strings
|
||||
info • Invalid use of a private type in a public API • lib/comp_8.dart:26:3 • library_private_types_in_public_api
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_8.dart:90:34 • deprecated_member_use
|
||||
info • 'value' is deprecated and shouldn't be used. Use initialValue instead. This will set the initial value for the form field. This feature was deprecated after v3.33.0-1.0.pre • lib/comp_8.dart:329:31 • deprecated_member_use
|
||||
info • 'activeColor' is deprecated and shouldn't be used. Use activeThumbColor instead. This feature was deprecated after v3.31.0-2.0.pre • lib/comp_8.dart:469:15 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_8.dart:470:45 • deprecated_member_use
|
||||
info • Invalid use of a private type in a public API • lib/comp_9.dart:27:3 • library_private_types_in_public_api
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_9.dart:90:34 • deprecated_member_use
|
||||
info • 'value' is deprecated and shouldn't be used. Use initialValue instead. This will set the initial value for the form field. This feature was deprecated after v3.33.0-1.0.pre • lib/comp_9.dart:435:25 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/comp_9.dart:509:135 • deprecated_member_use
|
||||
info • Don't invoke 'print' in production code • lib/firebase_exchange.dart:63:7 • avoid_print
|
||||
info • The variable name 'data_incidente' isn't a lowerCamelCase identifier • lib/global_data.dart:12:17 • non_constant_identifier_names
|
||||
info • The variable name 'Veicoli_danni_materiali_oltre' isn't a lowerCamelCase identifier • lib/global_data.dart:17:15 • non_constant_identifier_names
|
||||
info • The variable name 'Oggetti_diversi_danni_materiali' isn't a lowerCamelCase identifier • lib/global_data.dart:18:15 • non_constant_identifier_names
|
||||
info • The variable name 'Cognome_contraente_A' isn't a lowerCamelCase identifier • lib/global_data.dart:21:17 • non_constant_identifier_names
|
||||
info • The variable name 'Nome_contraente_A' isn't a lowerCamelCase identifier • lib/global_data.dart:21:58 • non_constant_identifier_names
|
||||
info • The variable name 'Codice_Fiscale_contraente_A' isn't a lowerCamelCase identifier • lib/global_data.dart:21:96 • non_constant_identifier_names
|
||||
info • The variable name 'Indirizzo_contraente_A' isn't a lowerCamelCase identifier • lib/global_data.dart:21:144 • non_constant_identifier_names
|
||||
info • The variable name 'CAP_contraente_A' isn't a lowerCamelCase identifier • lib/global_data.dart:21:187 • non_constant_identifier_names
|
||||
info • The variable name 'Stato_contraente_A' isn't a lowerCamelCase identifier • lib/global_data.dart:21:224 • non_constant_identifier_names
|
||||
info • The variable name 'N_telefono_mail_contraente_A' isn't a lowerCamelCase identifier • lib/global_data.dart:21:263 • non_constant_identifier_names
|
||||
info • The variable name 'Marca_e_Tipo_A' isn't a lowerCamelCase identifier • lib/global_data.dart:22:17 • non_constant_identifier_names
|
||||
info • The variable name 'Targa_A' isn't a lowerCamelCase identifier • lib/global_data.dart:22:52 • non_constant_identifier_names
|
||||
info • The variable name 'Stato_immatricolazione_A' isn't a lowerCamelCase identifier • lib/global_data.dart:22:80 • non_constant_identifier_names
|
||||
info • The variable name 'Rimorchio_A' isn't a lowerCamelCase identifier • lib/global_data.dart:22:125 • non_constant_identifier_names
|
||||
info • The variable name 'Stato_immatricolazione2_A' isn't a lowerCamelCase identifier • lib/global_data.dart:22:157 • non_constant_identifier_names
|
||||
info • The variable name 'Denominazione_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:17 • non_constant_identifier_names
|
||||
info • The variable name 'Numero_Polizza_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:53 • non_constant_identifier_names
|
||||
info • The variable name 'N_carta_verde_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:90 • non_constant_identifier_names
|
||||
info • The variable name 'Data_Inizio_Dal_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:126 • non_constant_identifier_names
|
||||
info • The variable name 'Data_Scadenza_Al_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:164 • non_constant_identifier_names
|
||||
info • The variable name 'Agenzia_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:203 • non_constant_identifier_names
|
||||
info • The variable name 'Denominazione_agenzia_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:233 • non_constant_identifier_names
|
||||
info • The variable name 'Indirizzo_agenzia_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:277 • non_constant_identifier_names
|
||||
info • The variable name 'Stato_agenzia_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:317 • non_constant_identifier_names
|
||||
info • The variable name 'N_tel_mail_agenzia_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:353 • non_constant_identifier_names
|
||||
info • The variable name 'FLAG_danni_mat_assicurati_A' isn't a lowerCamelCase identifier • lib/global_data.dart:23:392 • non_constant_identifier_names
|
||||
info • The variable name 'Cognome_cond_A' isn't a lowerCamelCase identifier • lib/global_data.dart:24:17 • non_constant_identifier_names
|
||||
info • The variable name 'Nome_cond_A' isn't a lowerCamelCase identifier • lib/global_data.dart:24:52 • non_constant_identifier_names
|
||||
info • The variable name 'Data_nascita_cond_A' isn't a lowerCamelCase identifier • lib/global_data.dart:24:84 • non_constant_identifier_names
|
||||
info • The variable name 'Cod_fiscale_cond_A' isn't a lowerCamelCase identifier • lib/global_data.dart:24:124 • non_constant_identifier_names
|
||||
info • The variable name 'Indirizzo_cond_A' isn't a lowerCamelCase identifier • lib/global_data.dart:24:163 • non_constant_identifier_names
|
||||
info • The variable name 'Stato_cond_A' isn't a lowerCamelCase identifier • lib/global_data.dart:24:200 • non_constant_identifier_names
|
||||
info • The variable name 'N_tel_mail_cond_A' isn't a lowerCamelCase identifier • lib/global_data.dart:24:233 • non_constant_identifier_names
|
||||
info • The variable name 'N_Patente_cond_A' isn't a lowerCamelCase identifier • lib/global_data.dart:24:271 • non_constant_identifier_names
|
||||
info • The variable name 'Scadenza_cond_A' isn't a lowerCamelCase identifier • lib/global_data.dart:24:308 • non_constant_identifier_names
|
||||
info • The variable name 'Categoria_cond_A' isn't a lowerCamelCase identifier • lib/global_data.dart:24:344 • non_constant_identifier_names
|
||||
info • The variable name 'puntiUrtoA_List' isn't a lowerCamelCase identifier • lib/global_data.dart:25:23 • non_constant_identifier_names
|
||||
info • The variable name 'danni_visibili_A' isn't a lowerCamelCase identifier • lib/global_data.dart:25:59 • non_constant_identifier_names
|
||||
info • The variable name 'osservazioni_A' isn't a lowerCamelCase identifier • lib/global_data.dart:25:96 • non_constant_identifier_names
|
||||
info • The variable name 'Cognome_contraente_B' isn't a lowerCamelCase identifier • lib/global_data.dart:28:17 • non_constant_identifier_names
|
||||
info • The variable name 'Nome_contraente_B' isn't a lowerCamelCase identifier • lib/global_data.dart:28:58 • non_constant_identifier_names
|
||||
info • The variable name 'Codice_Fiscale_contraente_B' isn't a lowerCamelCase identifier • lib/global_data.dart:28:96 • non_constant_identifier_names
|
||||
info • The variable name 'Indirizzo_contraente_B' isn't a lowerCamelCase identifier • lib/global_data.dart:28:144 • non_constant_identifier_names
|
||||
info • The variable name 'CAP_contraente_B' isn't a lowerCamelCase identifier • lib/global_data.dart:28:187 • non_constant_identifier_names
|
||||
info • The variable name 'Stato_contraente_B' isn't a lowerCamelCase identifier • lib/global_data.dart:28:224 • non_constant_identifier_names
|
||||
info • The variable name 'N_telefono_mail_contraente_B' isn't a lowerCamelCase identifier • lib/global_data.dart:28:263 • non_constant_identifier_names
|
||||
info • The variable name 'Marca_e_Tipo_B' isn't a lowerCamelCase identifier • lib/global_data.dart:29:17 • non_constant_identifier_names
|
||||
info • The variable name 'Targa_B' isn't a lowerCamelCase identifier • lib/global_data.dart:29:52 • non_constant_identifier_names
|
||||
info • The variable name 'Stato_immatricolazione_B' isn't a lowerCamelCase identifier • lib/global_data.dart:29:80 • non_constant_identifier_names
|
||||
info • The variable name 'Rimorchio_B' isn't a lowerCamelCase identifier • lib/global_data.dart:29:125 • non_constant_identifier_names
|
||||
info • The variable name 'Stato_immatricolazione2_B' isn't a lowerCamelCase identifier • lib/global_data.dart:29:157 • non_constant_identifier_names
|
||||
info • The variable name 'Denominazione_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:17 • non_constant_identifier_names
|
||||
info • The variable name 'Numero_Polizza_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:53 • non_constant_identifier_names
|
||||
info • The variable name 'N_carta_verde_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:90 • non_constant_identifier_names
|
||||
info • The variable name 'Data_Inizio_Dal_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:126 • non_constant_identifier_names
|
||||
info • The variable name 'Data_Scadenza_Al_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:164 • non_constant_identifier_names
|
||||
info • The variable name 'Agenzia_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:203 • non_constant_identifier_names
|
||||
info • The variable name 'Denominazione_agenzia_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:233 • non_constant_identifier_names
|
||||
info • The variable name 'Indirizzo_agenzia_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:277 • non_constant_identifier_names
|
||||
info • The variable name 'Stato_agenzia_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:317 • non_constant_identifier_names
|
||||
info • The variable name 'N_tel_mail_agenzia_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:353 • non_constant_identifier_names
|
||||
info • The variable name 'FLAG_danni_mat_assicurati_B' isn't a lowerCamelCase identifier • lib/global_data.dart:30:392 • non_constant_identifier_names
|
||||
info • The variable name 'Cognome_cond_B' isn't a lowerCamelCase identifier • lib/global_data.dart:31:17 • non_constant_identifier_names
|
||||
info • The variable name 'Nome_cond_B' isn't a lowerCamelCase identifier • lib/global_data.dart:31:52 • non_constant_identifier_names
|
||||
info • The variable name 'Data_nascita_cond_B' isn't a lowerCamelCase identifier • lib/global_data.dart:31:84 • non_constant_identifier_names
|
||||
info • The variable name 'Cod_fiscale_cond_B' isn't a lowerCamelCase identifier • lib/global_data.dart:31:124 • non_constant_identifier_names
|
||||
info • The variable name 'Indirizzo_cond_B' isn't a lowerCamelCase identifier • lib/global_data.dart:31:163 • non_constant_identifier_names
|
||||
info • The variable name 'Stato_cond_B' isn't a lowerCamelCase identifier • lib/global_data.dart:31:200 • non_constant_identifier_names
|
||||
info • The variable name 'N_tel_mail_cond_B' isn't a lowerCamelCase identifier • lib/global_data.dart:31:233 • non_constant_identifier_names
|
||||
info • The variable name 'N_Patente_cond_B' isn't a lowerCamelCase identifier • lib/global_data.dart:31:271 • non_constant_identifier_names
|
||||
info • The variable name 'Scadenza_cond_B' isn't a lowerCamelCase identifier • lib/global_data.dart:31:308 • non_constant_identifier_names
|
||||
info • The variable name 'Categoria_cond_B' isn't a lowerCamelCase identifier • lib/global_data.dart:31:344 • non_constant_identifier_names
|
||||
info • The variable name 'puntiUrtoB_List' isn't a lowerCamelCase identifier • lib/global_data.dart:32:23 • non_constant_identifier_names
|
||||
info • The variable name 'danni_visibili_B' isn't a lowerCamelCase identifier • lib/global_data.dart:32:59 • non_constant_identifier_names
|
||||
info • The variable name 'osservazioni_B' isn't a lowerCamelCase identifier • lib/global_data.dart:32:96 • non_constant_identifier_names
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/main.dart:153:49 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/main.dart:254:41 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/main.dart:260:23 • deprecated_member_use
|
||||
info • 'red' is deprecated and shouldn't be used. Use (*.r * 255.0).round().clamp(0, 255) • lib/main.dart:262:42 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/main.dart:271:37 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/main.dart:289:77 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/main.dart:310:40 • deprecated_member_use
|
||||
warning • Unused import: 'dart:math' • lib/models.dart:4:8 • unused_import
|
||||
info • Statements in a for should be enclosed in a block • lib/models.dart:26:33 • curly_braces_in_flow_control_structures
|
||||
info • Statements in a for should be enclosed in a block • lib/models.dart:165:52 • curly_braces_in_flow_control_structures
|
||||
info • Statements in a for should be enclosed in a block • lib/models.dart:166:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:69:24 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:70:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:71:33 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:74:24 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:75:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:76:33 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:87:23 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:88:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:89:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:90:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/pdf_engine.dart:91:16 • curly_braces_in_flow_control_structures
|
||||
info • Statements in a for should be enclosed in a block • lib/pdf_engine.dart:99:56 • curly_braces_in_flow_control_structures
|
||||
info • Statements in a for should be enclosed in a block • lib/pdf_engine.dart:100:56 • curly_braces_in_flow_control_structures
|
||||
info • Statements in a for should be enclosed in a block • lib/pdf_engine.dart:442:33 • curly_braces_in_flow_control_structures
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pdf_engine.dart:497:50 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/pdf_engine.dart:556:50 • deprecated_member_use
|
||||
info • Don't invoke 'print' in production code • lib/pdf_inspector.dart:10:5 • avoid_print
|
||||
info • Don't invoke 'print' in production code • lib/pdf_inspector.dart:18:3 • avoid_print
|
||||
info • Don't invoke 'print' in production code • lib/pdf_inspector.dart:19:3 • avoid_print
|
||||
info • Don't invoke 'print' in production code • lib/pdf_inspector.dart:28:5 • avoid_print
|
||||
info • Don't invoke 'print' in production code • lib/pdf_inspector.dart:30:3 • avoid_print
|
||||
warning • The value of the field '_posizioneUtente' isn't used • lib/ps.dart:18:13 • unused_field
|
||||
info • 'desiredAccuracy' is deprecated and shouldn't be used. use settings parameter with AndroidSettings, AppleSettings, WebSettings, or LocationSettings • lib/ps.dart:96:48 • deprecated_member_use
|
||||
info • Statements in an if should be enclosed in a block • lib/ps.dart:170:47 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/ps.dart:171:52 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/ps.dart:172:50 • curly_braces_in_flow_control_structures
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/ps.dart:212:51 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/ps.dart:214:70 • deprecated_member_use
|
||||
warning • Unused import: 'dart:convert' • lib/scambio_dati_screen.dart:2:8 • unused_import
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/scelta_lato.dart:223:30 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/scelta_lato.dart:230:30 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/scelta_lato.dart:262:43 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/scelta_lato.dart:277:54 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/scelta_lato.dart:308:49 • deprecated_member_use
|
||||
error • Target of URI doesn't exist: 'scambio_dati_screen.dart' • lib/temp/comp_16.dart:12:8 • uri_does_not_exist
|
||||
error • Target of URI doesn't exist: 'global_data.dart' • lib/temp/comp_16.dart:14:8 • uri_does_not_exist
|
||||
error • Target of URI doesn't exist: 'main.dart' • lib/temp/comp_16.dart:15:8 • uri_does_not_exist
|
||||
error • Target of URI doesn't exist: 'comp_6-7.dart' • lib/temp/comp_16.dart:16:8 • uri_does_not_exist
|
||||
error • Target of URI doesn't exist: 'comp_1-5.dart' • lib/temp/comp_16.dart:17:8 • uri_does_not_exist
|
||||
info • The private field _staCancellando could be 'final' • lib/temp/comp_16.dart:32:8 • prefer_final_fields
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:53:9 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:53:51 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:54:7 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:54:40 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:56:9 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:57:11 • undefined_identifier
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/comp_16.dart:57:43 • curly_braces_in_flow_control_structures
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:57:43 • undefined_identifier
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/comp_16.dart:57:69 • curly_braces_in_flow_control_structures
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:57:69 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:64:9 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:65:16 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:65:69 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:67:16 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:67:69 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:100:29 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:100:63 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:141:24 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:141:49 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:171:9 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:171:69 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:172:9 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:172:60 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:194:11 • undefined_identifier
|
||||
error • The name 'Comp1_5Screen' isn't a class • lib/temp/comp_16.dart:195:84 • creation_with_non_type
|
||||
error • The name 'Comp6_7Screen' isn't a class • lib/temp/comp_16.dart:197:84 • creation_with_non_type
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:203:18 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:203:43 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:206:25 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:220:5 • undefined_identifier
|
||||
error • The name 'HomeScreen' isn't a class • lib/temp/comp_16.dart:223:85 • creation_with_non_type
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:228:9 • undefined_identifier
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/comp_16.dart:228:41 • curly_braces_in_flow_control_structures
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:228:41 • undefined_identifier
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/comp_16.dart:228:67 • curly_braces_in_flow_control_structures
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:228:67 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:229:5 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:230:5 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:290:25 • undefined_identifier
|
||||
error • The name 'Comp1_5Screen' isn't a class • lib/temp/comp_16.dart:291:98 • creation_with_non_type
|
||||
error • The name 'Comp6_7Screen' isn't a class • lib/temp/comp_16.dart:293:98 • creation_with_non_type
|
||||
error • The name 'ScambioDatiScreen' isn't a class • lib/temp/comp_16.dart:337:81 • creation_with_non_type
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:358:18 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:359:40 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:359:70 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:360:38 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:360:59 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:361:40 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:361:71 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:361:109 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:361:143 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:362:41 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:362:83 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:364:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:364:68 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:367:11 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:368:29 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:370:25 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:372:33 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:383:102 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:383:140 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/comp_16.dart:383:172 • undefined_identifier
|
||||
info • Don't use 'BuildContext's across async gaps, guarded by an unrelated 'mounted' check • lib/temp/comp_16.dart:398:41 • use_build_context_synchronously
|
||||
info • 'onPopInvoked' is deprecated and shouldn't be used. Use onPopInvokedWithResult instead. This feature was deprecated after v3.22.0-12.0.pre • lib/temp/comp_16.dart:426:7 • deprecated_member_use
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/comp_16.dart:428:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/comp_16.dart:428:52 • curly_braces_in_flow_control_structures
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/temp/comp_16.dart:435:49 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/temp/comp_16.dart:459:41 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/temp/comp_16.dart:493:56 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/temp/comp_16.dart:515:55 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/temp/comp_16.dart:515:207 • deprecated_member_use
|
||||
info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/temp/comp_16.dart:541:44 • deprecated_member_use
|
||||
info • Don't use 'BuildContext's across async gaps • lib/temp/comp_16.dart:576:21 • use_build_context_synchronously
|
||||
error • Target of URI doesn't exist: 'global_data.dart' • lib/temp/pdf_engine.dart:8:8 • uri_does_not_exist
|
||||
error • Target of URI doesn't exist: 'models.dart' • lib/temp/pdf_engine.dart:9:8 • uri_does_not_exist
|
||||
error • Target of URI doesn't exist: 'cai_mapping.dart' • lib/temp/pdf_engine.dart:10:8 • uri_does_not_exist
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:39:7 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:52:29 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:52:49 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:52:72 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:53:29 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:53:72 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:53:102 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:54:29 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:54:74 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:54:104 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:55:29 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:55:70 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:55:98 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:56:29 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:56:70 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:56:98 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:58:21 • undefined_identifier
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:59:24 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:60:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:61:33 • curly_braces_in_flow_control_structures
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:63:21 • undefined_identifier
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:64:24 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:65:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:66:33 • curly_braces_in_flow_control_structures
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:72:13 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:75:13 • undefined_identifier
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:77:23 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:78:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:79:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:80:29 • curly_braces_in_flow_control_structures
|
||||
info • Statements in an if should be enclosed in a block • lib/temp/pdf_engine.dart:81:16 • curly_braces_in_flow_control_structures
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:89:28 • undefined_identifier
|
||||
info • Statements in a for should be enclosed in a block • lib/temp/pdf_engine.dart:89:56 • curly_braces_in_flow_control_structures
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:90:28 • undefined_identifier
|
||||
info • Statements in a for should be enclosed in a block • lib/temp/pdf_engine.dart:90:56 • curly_braces_in_flow_control_structures
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:93:45 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:94:35 • undefined_identifier
|
||||
error • The name 'TrattoPenna' isn't a type, so it can't be used as a type argument • lib/temp/pdf_engine.dart:94:58 • non_type_as_type_argument
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:94:83 • undefined_identifier
|
||||
error • The name 'ElementoGrafico' isn't a type, so it can't be used as a type argument • lib/temp/pdf_engine.dart:94:108 • non_type_as_type_argument
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:96:45 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:96:93 • undefined_identifier
|
||||
error • Undefined name 'CaiMapping' • lib/temp/pdf_engine.dart:97:45 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:97:93 • undefined_identifier
|
||||
error • The name 'TrattoPenna' isn't a type, so it can't be used as a type argument • lib/temp/pdf_engine.dart:239:52 • non_type_as_type_argument
|
||||
error • The name 'ElementoGrafico' isn't a type, so it can't be used as a type argument • lib/temp/pdf_engine.dart:239:78 • non_type_as_type_argument
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:252:37 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:253:26 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:254:28 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:255:32 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:256:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:257:37 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:258:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:259:37 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:260:43 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:261:40 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:262:50 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:263:45 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:264:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:265:41 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:266:51 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:267:37 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:268:30 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:269:47 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:270:34 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:271:48 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:272:38 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:273:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:274:38 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:275:40 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:276:41 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:277:32 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:278:42 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:279:38 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:280:46 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:281:43 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:282:37 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:283:34 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:284:42 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:285:41 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:286:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:287:35 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:288:40 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:289:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:290:38 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:291:43 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:292:40 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:293:50 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:294:45 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:295:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:296:41 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:297:51 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:298:37 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:299:30 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:300:47 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:301:34 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:302:48 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:303:38 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:304:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:305:38 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:306:40 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:307:41 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:308:32 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:309:42 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:310:38 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:311:46 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:312:43 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:313:37 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:314:34 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:315:42 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:316:41 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:317:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:318:35 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:319:40 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:320:39 • undefined_identifier
|
||||
error • Undefined name 'GlobalData' • lib/temp/pdf_engine.dart:321:38 • undefined_identifier
|
||||
error • The name 'TrattoPenna' isn't a type, so it can't be used as a type argument • lib/temp/pdf_engine.dart:328:12 • non_type_as_type_argument
|
||||
error • The name 'ElementoGrafico' isn't a type, so it can't be used as a type argument • lib/temp/pdf_engine.dart:329:12 • non_type_as_type_argument
|
||||
info • Statements in a for should be enclosed in a block • lib/temp/pdf_engine.dart:412:31 • curly_braces_in_flow_control_structures
|
||||
info • Invalid use of a private type in a public API • lib/test_scraping.dart:14:3 • library_private_types_in_public_api
|
||||
info • Don't use 'BuildContext's across async gaps • lib/test_scraping.dart:38:28 • use_build_context_synchronously
|
||||
info • Invalid use of a private type in a public API • lib/verifica_rca_screen.dart:11:3 • library_private_types_in_public_api
|
||||
|
||||
|
|
@ -130,9 +130,7 @@ class CidDataManager {
|
|||
|
||||
// 3. Circostanze
|
||||
if (data['circostanze'] != null) {
|
||||
Map<String, dynamic> rawCirc = data['circostanze'];
|
||||
Map<int, bool> mappaCirc = {};
|
||||
rawCirc.forEach((k, v) => mappaCirc[int.tryParse(k) ?? 0] = v as bool);
|
||||
Map<int, bool> mappaCirc = fixCircostanze(data['circostanze']);
|
||||
if (latoRemoto == 'A') GlobalData.circostanzeA = mappaCirc;
|
||||
else GlobalData.circostanzeB = mappaCirc;
|
||||
}
|
||||
|
|
@ -308,4 +306,26 @@ class CidDataManager {
|
|||
return Offset((item['dx'] as num).toDouble(), (item['dy'] as num).toDouble());
|
||||
}).toList();
|
||||
}
|
||||
|
||||
static Map<int, bool> fixCircostanze(dynamic rawData) {
|
||||
Map<int, bool> mappaCirc = {};
|
||||
if (rawData == null) return mappaCirc;
|
||||
|
||||
if (rawData is List) {
|
||||
// Firebase ha convertito le chiavi intere in un array
|
||||
for (int i = 0; i < rawData.length; i++) {
|
||||
if (rawData[i] != null) {
|
||||
mappaCirc[i] = rawData[i] as bool;
|
||||
}
|
||||
}
|
||||
} else if (rawData is Map) {
|
||||
// È rimasta una mappa
|
||||
rawData.forEach((k, v) {
|
||||
if (v != null) {
|
||||
mappaCirc[int.tryParse(k.toString()) ?? 0] = v as bool;
|
||||
}
|
||||
});
|
||||
}
|
||||
return mappaCirc;
|
||||
}
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ class _Comp1_5ScreenState extends State<Comp1_5Screen> {
|
|||
context: context,
|
||||
barrierDismissible: false, // Obbliga l'utente a premere "Ho capito"
|
||||
barrierLabel: "Popup",
|
||||
barrierColor: Colors.black.withOpacity(0.5), // Sfondo scuro
|
||||
barrierColor: Colors.black.withValues(alpha: 0.5), // Sfondo scuro
|
||||
transitionDuration: const Duration(milliseconds: 400), // Durata della dissolvenza (300 millisecondi)
|
||||
pageBuilder: (context, animation, secondaryAnimation) {
|
||||
return AlertDialog(
|
||||
|
|
@ -424,7 +424,7 @@ class _Comp1_5ScreenState extends State<Comp1_5Screen> {
|
|||
value: value,
|
||||
onChanged: onChanged,
|
||||
activeColor: activeColor,
|
||||
activeTrackColor: activeColor.withOpacity(0.4),
|
||||
activeTrackColor: activeColor.withValues(alpha: 0.4),
|
||||
inactiveThumbColor: Colors.grey,
|
||||
inactiveTrackColor: Colors.grey.shade300,
|
||||
),
|
||||
|
|
@ -464,7 +464,7 @@ class _Comp1_5ScreenState extends State<Comp1_5Screen> {
|
|||
Widget _buildCard({required String titolo, required Widget child, required Color accentColor}) {
|
||||
return Container(
|
||||
width: double.infinity, margin: const EdgeInsets.only(bottom: 20), padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.08), blurRadius: 10, offset: const Offset(0, 4))]),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15), boxShadow: [BoxShadow(color: Colors.black.withValues(alpha: 0.08), blurRadius: 10, offset: const Offset(0, 4))]),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Text(titolo, style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: accentColor)),
|
||||
const Divider(height: 25, thickness: 1.2),
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class _Comp10ScreenState extends State<Comp10Screen> {
|
|||
context: context,
|
||||
barrierDismissible: false,
|
||||
barrierLabel: "Popup",
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
barrierColor: Colors.black.withValues(alpha: 0.5),
|
||||
transitionDuration: const Duration(milliseconds: 400),
|
||||
pageBuilder: (context, animation, secondaryAnimation) {
|
||||
return AlertDialog(
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class _Comp12ScreenState extends State<Comp12Screen> {
|
|||
context: context,
|
||||
barrierDismissible: false,
|
||||
barrierLabel: "Popup",
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
barrierColor: Colors.black.withValues(alpha: 0.5),
|
||||
transitionDuration: const Duration(milliseconds: 400),
|
||||
pageBuilder: (context, animation, secondaryAnimation) {
|
||||
return AlertDialog(
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ class _Comp13ScreenState extends State<Comp13Screen> {
|
|||
width: 55,
|
||||
constraints: BoxConstraints(maxHeight: maxToolbarHeight),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.95),
|
||||
color: Colors.white.withValues(alpha: 0.95),
|
||||
borderRadius: BorderRadius.circular(25),
|
||||
boxShadow: [const BoxShadow(color: Colors.black26, blurRadius: 4)],
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
|
|
@ -346,7 +346,7 @@ class _Comp13ScreenState extends State<Comp13Screen> {
|
|||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? activeColor.withOpacity(0.15) : Colors.transparent,
|
||||
color: isSelected ? activeColor.withValues(alpha: 0.15) : Colors.transparent,
|
||||
border: isSelected ? Border.all(color: activeColor, width: 2) : null,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
|
|
@ -446,7 +446,7 @@ class PainterV40 extends CustomPainter {
|
|||
RRect bodyRect = RRect.fromRectAndRadius(Rect.fromCenter(center: Offset.zero, width: w, height: h), const Radius.circular(5));
|
||||
canvas.drawRRect(bodyRect, pBody);
|
||||
|
||||
Paint pCabin = Paint()..color = Colors.black.withOpacity(0.2);
|
||||
Paint pCabin = Paint()..color = Colors.black.withValues(alpha: 0.2);
|
||||
canvas.drawRect(Rect.fromLTRB(-w/2 + 6, -h/2 + 3, w/4, h/2 - 3), pCabin);
|
||||
|
||||
Paint pLights = Paint()..color = Colors.yellow;
|
||||
|
|
@ -505,7 +505,7 @@ class PainterV40 extends CustomPainter {
|
|||
canvas.drawRect(cabinaRect, pBody);
|
||||
canvas.drawRect(cabinaRect, pBorder);
|
||||
|
||||
Paint pVetro = Paint()..color = Colors.black.withOpacity(0.3);
|
||||
Paint pVetro = Paint()..color = Colors.black.withValues(alpha: 0.3);
|
||||
canvas.drawRect(Rect.fromLTRB(w/4 + 2, -h/2 + 3, w/2 - 2, h/2 - 3), pVetro);
|
||||
|
||||
Paint pLights = Paint()..color = Colors.yellow;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class _Comp16ScreenState extends State<Comp16Screen> with WidgetsBindingObserver
|
|||
context: context,
|
||||
barrierDismissible: false,
|
||||
barrierLabel: "Popup",
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
barrierColor: Colors.black.withValues(alpha: 0.5),
|
||||
transitionDuration: const Duration(milliseconds: 400),
|
||||
pageBuilder: (context, animation, secondaryAnimation) {
|
||||
return AlertDialog(
|
||||
|
|
@ -508,7 +508,7 @@ class _Comp16ScreenState extends State<Comp16Screen> with WidgetsBindingObserver
|
|||
image: const AssetImage('assets/sfondo_mappa.jpg'),
|
||||
fit: BoxFit.cover,
|
||||
colorFilter: ColorFilter.mode(
|
||||
const Color(0xFFF0F4F8).withOpacity(0.6),
|
||||
const Color(0xFFF0F4F8).withValues(alpha: 0.6),
|
||||
BlendMode.lighten,
|
||||
),
|
||||
),
|
||||
|
|
@ -525,7 +525,7 @@ class _Comp16ScreenState extends State<Comp16Screen> with WidgetsBindingObserver
|
|||
appBar: AppBar(
|
||||
title: const Text("Invio e Salvataggio", style: TextStyle(fontWeight: FontWeight.w800, fontSize: 20)),
|
||||
centerTitle: true,
|
||||
backgroundColor: Colors.blue.shade900.withOpacity(0.95),
|
||||
backgroundColor: Colors.blue.shade900.withValues(alpha: 0.95),
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 10,
|
||||
leading: IconButton(
|
||||
|
|
@ -552,7 +552,7 @@ class _Comp16ScreenState extends State<Comp16Screen> with WidgetsBindingObserver
|
|||
_btn(testoAnteprima, Icons.visibility, _statusColor, onTap: abilitaAnteprima ? _apriAnteprimaSchermoIntero : null, disabled: !abilitaAnteprima),
|
||||
|
||||
const SizedBox(height: 8),
|
||||
Divider(color: Colors.white.withOpacity(0.5), thickness: 1),
|
||||
Divider(color: Colors.white.withValues(alpha: 0.5), thickness: 1),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
Builder(builder: (ctx) => _btn("SALVA SUL DISPOSITIVO", Icons.save_alt, Colors.green.shade700, onTap: abilitaFinali ? () => _salvaPdfLocale(ctx) : null, disabled: !abilitaFinali)),
|
||||
|
|
@ -587,7 +587,7 @@ class _Comp16ScreenState extends State<Comp16Screen> with WidgetsBindingObserver
|
|||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: on ? [BoxShadow(color: Colors.black.withOpacity(0.3), offset: const Offset(0, 4), blurRadius: 5)] : [],
|
||||
boxShadow: on ? [BoxShadow(color: Colors.black.withValues(alpha: 0.3), offset: const Offset(0, 4), blurRadius: 5)] : [],
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed: on ? onTap : null,
|
||||
|
|
@ -609,7 +609,7 @@ class _Comp16ScreenState extends State<Comp16Screen> with WidgetsBindingObserver
|
|||
Widget _buildStatusCard() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(color: Colors.white.withOpacity(0.9), borderRadius: BorderRadius.circular(16), border: Border.all(color: _statusColor, width: 2), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.1), blurRadius: 6, offset: const Offset(0, 3))]),
|
||||
decoration: BoxDecoration(color: Colors.white.withValues(alpha: 0.9), borderRadius: BorderRadius.circular(16), border: Border.all(color: _statusColor, width: 2), boxShadow: [BoxShadow(color: Colors.black.withValues(alpha: 0.1), blurRadius: 6, offset: const Offset(0, 3))]),
|
||||
child: Row(children: [
|
||||
Icon(_statusIcon, color: _statusColor, size: 36), const SizedBox(width: 15),
|
||||
Expanded(child: Text(_statusText, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, color: _statusColor)))
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ class _Comp6_7ScreenState extends State<Comp6_7Screen> {
|
|||
context: context,
|
||||
barrierDismissible: false,
|
||||
barrierLabel: "Popup",
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
barrierColor: Colors.black.withValues(alpha: 0.5),
|
||||
transitionDuration: const Duration(milliseconds: 400),
|
||||
pageBuilder: (context, animation, secondaryAnimation) {
|
||||
return AlertDialog(
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class _Comp8ScreenState extends State<Comp8Screen> {
|
|||
context: context,
|
||||
barrierDismissible: false,
|
||||
barrierLabel: "Popup",
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
barrierColor: Colors.black.withValues(alpha: 0.5),
|
||||
transitionDuration: const Duration(milliseconds: 400),
|
||||
pageBuilder: (context, animation, secondaryAnimation) {
|
||||
return AlertDialog(
|
||||
|
|
@ -467,7 +467,7 @@ class _Comp8ScreenState extends State<Comp8Screen> {
|
|||
value: value,
|
||||
onChanged: onChanged,
|
||||
activeColor: activeColor,
|
||||
activeTrackColor: activeColor.withOpacity(0.4),
|
||||
activeTrackColor: activeColor.withValues(alpha: 0.4),
|
||||
inactiveThumbColor: Colors.grey,
|
||||
inactiveTrackColor: Colors.grey.shade300,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class _Comp9ScreenState extends State<Comp9Screen> {
|
|||
context: context,
|
||||
barrierDismissible: false,
|
||||
barrierLabel: "Popup",
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
barrierColor: Colors.black.withValues(alpha: 0.5),
|
||||
transitionDuration: const Duration(milliseconds: 400),
|
||||
pageBuilder: (context, animation, secondaryAnimation) {
|
||||
return AlertDialog(
|
||||
|
|
@ -506,7 +506,7 @@ class _Comp9ScreenState extends State<Comp9Screen> {
|
|||
|
||||
Widget _buildSectionCard({required String titolo, required List<Widget> children, required Color accentColor}) => Container(
|
||||
width: double.infinity, margin: const EdgeInsets.only(bottom: 20), padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)]),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15), boxShadow: [BoxShadow(color: Colors.black.withValues(alpha: 0.05), blurRadius: 10)]),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Text(titolo, style: TextStyle(fontWeight: FontWeight.bold, color: accentColor, fontSize: 17)),
|
||||
const Divider(height: 25), ...children,
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
|
|||
style: TextStyle(fontWeight: FontWeight.w900, letterSpacing: 1.5, fontSize: 24)
|
||||
),
|
||||
centerTitle: true,
|
||||
backgroundColor: Colors.blue.shade900.withOpacity(0.95),
|
||||
backgroundColor: Colors.blue.shade900.withValues(alpha: 0.95),
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 10,
|
||||
shape: const RoundedRectangleBorder(
|
||||
|
|
@ -251,13 +251,13 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
|
|||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(color: Colors.black.withOpacity(0.4), offset: const Offset(0, 6), blurRadius: 8, spreadRadius: 1)
|
||||
BoxShadow(color: Colors.black.withValues(alpha: 0.4), offset: const Offset(0, 6), blurRadius: 8, spreadRadius: 1)
|
||||
],
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
baseColor.withOpacity(0.9),
|
||||
baseColor.withValues(alpha: 0.9),
|
||||
baseColor,
|
||||
baseColor.withRed((baseColor.red - 20).clamp(0, 255))
|
||||
],
|
||||
|
|
@ -268,7 +268,7 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
|
|||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
onTap: onTap,
|
||||
splashColor: Colors.white.withOpacity(0.2),
|
||||
splashColor: Colors.white.withValues(alpha: 0.2),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20),
|
||||
child: Row(
|
||||
|
|
@ -286,7 +286,7 @@ class _HomeScreenState extends State<HomeScreen> with RouteAware {
|
|||
)
|
||||
)
|
||||
),
|
||||
Icon(Icons.arrow_forward_ios, size: 18, color: Colors.white.withOpacity(0.7)),
|
||||
Icon(Icons.arrow_forward_ios, size: 18, color: Colors.white.withValues(alpha: 0.7)),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -307,7 +307,7 @@ class BackgroundImage extends StatelessWidget {
|
|||
child: Image.asset(
|
||||
'assets/sfondo_mappa.jpg',
|
||||
fit: BoxFit.cover,
|
||||
color: const Color(0xFFF0F4F8).withOpacity(0.6),
|
||||
color: const Color(0xFFF0F4F8).withValues(alpha: 0.6),
|
||||
colorBlendMode: BlendMode.lighten,
|
||||
errorBuilder: (c, e, s) => Container(color: Colors.grey.shade200),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -494,7 +494,7 @@ class PainterV40 extends CustomPainter {
|
|||
canvas.drawRRect(bodyRect, pBody);
|
||||
|
||||
// Cabina
|
||||
Paint pCabin = Paint()..color = Colors.black.withOpacity(0.2);
|
||||
Paint pCabin = Paint()..color = Colors.black.withValues(alpha: 0.2);
|
||||
canvas.drawRect(Rect.fromLTRB(-w/2 + 6, -h/2 + 3, w/4, h/2 - 3), pCabin);
|
||||
|
||||
// Fari
|
||||
|
|
@ -553,7 +553,7 @@ class PainterV40 extends CustomPainter {
|
|||
canvas.drawRect(cabinaRect, pBorder);
|
||||
|
||||
// Parabrezza
|
||||
Paint pVetro = Paint()..color = Colors.black.withOpacity(0.3);
|
||||
Paint pVetro = Paint()..color = Colors.black.withValues(alpha: 0.3);
|
||||
canvas.drawRect(Rect.fromLTRB(w/4 + 2, -h/2 + 3, w/2 - 2, h/2 - 3), pVetro);
|
||||
|
||||
// Fari
|
||||
|
|
|
|||
|
|
@ -209,9 +209,9 @@ class _ProntoSoccorsoScreenState extends State<ProntoSoccorsoScreen> {
|
|||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: badgeColor.withOpacity(0.1),
|
||||
color: badgeColor.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(color: badgeColor.withOpacity(0.3))
|
||||
border: Border.all(color: badgeColor.withValues(alpha: 0.3))
|
||||
),
|
||||
child: Text(
|
||||
"Livello: $livello",
|
||||
|
|
|
|||
|
|
@ -220,14 +220,14 @@ class _SceltaLatoScreenState extends State<SceltaLatoScreen> {
|
|||
boxShadow: [
|
||||
// Ombra 1: "Spessore" (scura, nitida, vicina)
|
||||
BoxShadow(
|
||||
color: colorDark.withOpacity(0.6),
|
||||
color: colorDark.withValues(alpha: 0.6),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 8),
|
||||
spreadRadius: 1, // Espande leggermente l'ombra scura
|
||||
),
|
||||
// Ombra 2: "Sollevamento" (morbida, ampia, lontana)
|
||||
BoxShadow(
|
||||
color: colorDark.withOpacity(0.3),
|
||||
color: colorDark.withValues(alpha: 0.3),
|
||||
blurRadius: 25,
|
||||
offset: const Offset(0, 18),
|
||||
spreadRadius: -5, // Contrae l'ombra diffusa per non sporcare troppo
|
||||
|
|
@ -259,7 +259,7 @@ class _SceltaLatoScreenState extends State<SceltaLatoScreen> {
|
|||
color: isB ? Colors.black87 : Colors.white,
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
color: Colors.black.withValues(alpha: 0.3),
|
||||
offset: const Offset(2, 2),
|
||||
blurRadius: 4,
|
||||
)
|
||||
|
|
@ -274,7 +274,7 @@ class _SceltaLatoScreenState extends State<SceltaLatoScreen> {
|
|||
color: isB ? Colors.black87 : Colors.white,
|
||||
// Leggera ombra sul testo per contrasto
|
||||
shadows: [
|
||||
Shadow(color: Colors.black.withOpacity(0.2), offset: const Offset(1, 1), blurRadius: 2)
|
||||
Shadow(color: Colors.black.withValues(alpha: 0.2), offset: const Offset(1, 1), blurRadius: 2)
|
||||
]
|
||||
)
|
||||
),
|
||||
|
|
@ -305,7 +305,7 @@ class _SceltaLatoScreenState extends State<SceltaLatoScreen> {
|
|||
border: Border.all(color: Colors.blue.shade200, width: 1.5),
|
||||
// Aggiunta una leggera ombra per staccarlo dallo sfondo
|
||||
boxShadow: [
|
||||
BoxShadow(color: Colors.blue.shade100.withOpacity(0.5), blurRadius: 8, offset: const Offset(0, 4))
|
||||
BoxShadow(color: Colors.blue.shade100.withValues(alpha: 0.5), blurRadius: 8, offset: const Offset(0, 4))
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
|
|
|
|||
BIN
lib/temp/.DS_Store
vendored
BIN
lib/temp/.DS_Store
vendored
Binary file not shown.
|
|
@ -1,618 +0,0 @@
|
|||
import 'dart:io';
|
||||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_email_sender/flutter_email_sender.dart';
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:printing/printing.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import 'scambio_dati_screen.dart';
|
||||
import 'pdf_engine.dart';
|
||||
import 'global_data.dart';
|
||||
import 'main.dart';
|
||||
import 'comp_6-7.dart';
|
||||
import 'comp_1-5.dart';
|
||||
|
||||
class Comp16Screen extends StatefulWidget {
|
||||
const Comp16Screen({super.key});
|
||||
|
||||
@override
|
||||
State<Comp16Screen> createState() => _Comp16ScreenState();
|
||||
}
|
||||
|
||||
class _Comp16ScreenState extends State<Comp16Screen> with WidgetsBindingObserver {
|
||||
bool _scambioEffettuato = false;
|
||||
bool _datiPresenti = false;
|
||||
bool _ioHoApprovato = false;
|
||||
bool _tuttiHannoApprovato = false;
|
||||
|
||||
bool _staCancellando = false;
|
||||
bool _cancellazioneAvviataDaMe = false;
|
||||
|
||||
String _statusText = "Esegui lo Scambio Dati per iniziare.";
|
||||
Color _statusColor = Colors.orange.shade800;
|
||||
IconData _statusIcon = Icons.warning_amber_rounded;
|
||||
|
||||
File? _filePdfReale;
|
||||
Uint8List? _immagineAnteprima;
|
||||
bool _isLoading = false;
|
||||
StreamSubscription? _roomSubscription;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
_puliziaIngresso();
|
||||
}
|
||||
|
||||
Future<void> _puliziaIngresso() async {
|
||||
if (GlobalData.idScambioTemporaneo == null && GlobalData.idSessione != null) {
|
||||
GlobalData.idScambioTemporaneo = GlobalData.idSessione;
|
||||
}
|
||||
if (GlobalData.idScambioTemporaneo == null) {
|
||||
if (GlobalData.latoCorrente == 'A') GlobalData.resetB(); else GlobalData.resetA();
|
||||
}
|
||||
if (mounted) _verificaStatoPostScambio();
|
||||
}
|
||||
|
||||
void _verificaStatoPostScambio() {
|
||||
bool datiOk = false;
|
||||
if (GlobalData.latoCorrente == 'A') {
|
||||
datiOk = GlobalData.Cognome_contraente_B.trim().isNotEmpty && GlobalData.Targa_B.trim().isNotEmpty;
|
||||
} else {
|
||||
datiOk = GlobalData.Cognome_contraente_A.trim().isNotEmpty && GlobalData.Targa_A.trim().isNotEmpty;
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
if (datiOk) {
|
||||
_scambioEffettuato = true;
|
||||
_datiPresenti = true;
|
||||
_statusText = "Dati ricevuti. Generazione anteprima...";
|
||||
_statusColor = Colors.blue.shade800;
|
||||
_statusIcon = Icons.pending_actions;
|
||||
_generaDocumenti();
|
||||
_attivaAscoltoStanza();
|
||||
} else {
|
||||
_resetStatiUI();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _resetStatiUI() {
|
||||
_scambioEffettuato = false;
|
||||
_datiPresenti = false;
|
||||
_ioHoApprovato = false;
|
||||
_tuttiHannoApprovato = false;
|
||||
_statusText = "Esegui lo Scambio Dati per iniziare.";
|
||||
_statusColor = Colors.orange.shade800;
|
||||
_statusIcon = Icons.warning_amber_rounded;
|
||||
_filePdfReale = null;
|
||||
_immagineAnteprima = null;
|
||||
}
|
||||
|
||||
void _attivaAscoltoStanza() {
|
||||
String? idDaAscoltare = GlobalData.idScambioTemporaneo ?? GlobalData.idSessione;
|
||||
if (idDaAscoltare == null || _roomSubscription != null) return;
|
||||
|
||||
_roomSubscription = FirebaseFirestore.instance
|
||||
.collection('scambi_cid')
|
||||
.doc(idDaAscoltare)
|
||||
.snapshots()
|
||||
.listen((snapshot) async {
|
||||
|
||||
if (!snapshot.exists) {
|
||||
if (_ioHoApprovato) {
|
||||
_roomSubscription?.cancel();
|
||||
_roomSubscription = null;
|
||||
return;
|
||||
}
|
||||
if (!_staCancellando && !_cancellazioneAvviataDaMe && mounted) {
|
||||
_gestisciCancellazioneAltrui();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final data = snapshot.data();
|
||||
if (data == null) return;
|
||||
|
||||
if (data['status'] == 'retry') {
|
||||
if (!_cancellazioneAvviataDaMe) _gestisciCancellazioneAltrui();
|
||||
return;
|
||||
}
|
||||
|
||||
bool appA = data['approved_A'] == true;
|
||||
bool appB = data['approved_B'] == true;
|
||||
|
||||
if (appA && appB) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_tuttiHannoApprovato = true;
|
||||
_ioHoApprovato = true;
|
||||
_statusText = "DATI APPROVATI!\nPDF creato procedi con il salvataggio sul dispositivo o invialo";
|
||||
_statusColor = Colors.green.shade800;
|
||||
_statusIcon = Icons.check_circle;
|
||||
});
|
||||
String? id = GlobalData.idSessione ?? GlobalData.idScambioTemporaneo;
|
||||
if (id != null) FirebaseFirestore.instance.collection('scambi_cid').doc(id).delete().catchError((_){});
|
||||
}
|
||||
}
|
||||
else if (_ioHoApprovato) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_statusText = "Hai approvato. In attesa dell'altro utente...";
|
||||
_statusColor = Colors.amber.shade800;
|
||||
_statusIcon = Icons.hourglass_top;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// GESTIONE CANCELLAZIONE
|
||||
// ===========================================================================
|
||||
|
||||
Future<void> _eseguiPuliziaFirebase({required bool notificaAltri}) async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_cancellazioneAvviataDaMe = true;
|
||||
});
|
||||
|
||||
await _roomSubscription?.cancel();
|
||||
_roomSubscription = null;
|
||||
|
||||
Set<String> idsDaCancellare = {};
|
||||
if (GlobalData.idScambioTemporaneo != null) idsDaCancellare.add(GlobalData.idScambioTemporaneo!);
|
||||
if (GlobalData.idSessione != null) idsDaCancellare.add(GlobalData.idSessione!);
|
||||
|
||||
for (String id in idsDaCancellare) {
|
||||
if (notificaAltri) {
|
||||
try {
|
||||
await FirebaseFirestore.instance.collection('scambi_cid').doc(id).update({'status': 'retry'})
|
||||
.timeout(const Duration(seconds: 2));
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
} catch (_) {}
|
||||
}
|
||||
try {
|
||||
await FirebaseFirestore.instance.collection('scambi_cid').doc(id).delete();
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _tornaIndietroConPulizia() async {
|
||||
await _eseguiPuliziaFirebase(notificaAltri: true);
|
||||
_resetDatiLocali();
|
||||
|
||||
if (mounted) {
|
||||
setState(() => _isLoading = false);
|
||||
if (GlobalData.latoCorrente == 'A') {
|
||||
Navigator.pushReplacement(context, MaterialPageRoute(builder: (c) => const Comp1_5Screen()));
|
||||
} else {
|
||||
Navigator.pushReplacement(context, MaterialPageRoute(builder: (c) => const Comp6_7Screen()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _ioApprovo() async {
|
||||
String? id = GlobalData.idSessione ?? GlobalData.idScambioTemporaneo;
|
||||
if (id != null) {
|
||||
try {
|
||||
String field = (GlobalData.latoCorrente == 'A') ? 'approved_A' : 'approved_B';
|
||||
await FirebaseFirestore.instance.collection('scambi_cid').doc(id).update({field: true});
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_ioHoApprovato = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _concludiEHome() async {
|
||||
await _eseguiPuliziaFirebase(notificaAltri: false);
|
||||
GlobalData.reset();
|
||||
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
if (mounted) {
|
||||
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (c) => const HomeScreen()), (r) => false);
|
||||
}
|
||||
}
|
||||
|
||||
void _resetDatiLocali() {
|
||||
if (GlobalData.latoCorrente == 'A') GlobalData.resetB(); else GlobalData.resetA();
|
||||
GlobalData.idScambioTemporaneo = null;
|
||||
GlobalData.idSessione = null;
|
||||
}
|
||||
|
||||
void _gestisciCancellazioneAltrui() {
|
||||
_roomSubscription?.cancel();
|
||||
_roomSubscription = null;
|
||||
|
||||
if (mounted) {
|
||||
// Chiude eventuali altri dialoghi aperti (es. quello dell'anteprima)
|
||||
Navigator.of(context).popUntil((route) => route.isFirst || route.settings.name == null);
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false, // L'utente DEVE premere il tasto
|
||||
builder: (ctx) => AlertDialog(
|
||||
// 1. Forma moderna con angoli molto arrotondati
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24.0)),
|
||||
backgroundColor: Colors.white,
|
||||
surfaceTintColor: Colors.transparent, // Evita tinte strane su Material 3
|
||||
|
||||
// 2. Icona grande in cima al titolo
|
||||
icon: Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
size: 60,
|
||||
color: Colors.amber.shade800
|
||||
),
|
||||
iconPadding: const EdgeInsets.only(top: 24, bottom: 16),
|
||||
|
||||
// 3. Titolo in grassetto
|
||||
title: Text(
|
||||
"Attenzione",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 22,
|
||||
color: Colors.amber.shade900
|
||||
)
|
||||
),
|
||||
|
||||
// 4. Contenuto con il tuo testo, centrato e leggibile
|
||||
content: const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Text(
|
||||
"L'altro utente ha deciso di modificare i propri dati o non ha accettato i tuoi.\n\nSarai riportato alla schermata iniziale dove potrai eventualmente apporre modifiche.",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 16, height: 1.4, color: Colors.black87),
|
||||
),
|
||||
),
|
||||
|
||||
// 5. Spaziatura azioni
|
||||
actionsPadding: const EdgeInsets.fromLTRB(24, 0, 24, 24),
|
||||
actions: [
|
||||
// 6. Pulsante moderno full-width
|
||||
SizedBox(
|
||||
width: double.infinity, // Occupa tutta la larghezza
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(ctx); // Chiude il dialog
|
||||
_resetDatiLocali(); // Pulisce la RAM
|
||||
// Torna alla schermata di input corretta
|
||||
if (GlobalData.latoCorrente == 'A') {
|
||||
Navigator.pushReplacement(context, MaterialPageRoute(builder: (c) => const Comp1_5Screen()));
|
||||
} else {
|
||||
Navigator.pushReplacement(context, MaterialPageRoute(builder: (c) => const Comp6_7Screen()));
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.amber.shade800, // Colore coerente con l'icona
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
elevation: 0, // Look più piatto e moderno
|
||||
),
|
||||
child: const Text(
|
||||
"HO CAPITO",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16)
|
||||
)
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _generaDocumenti() async {
|
||||
if (!mounted) return;
|
||||
setState(() => _isLoading = true);
|
||||
try {
|
||||
final List<int> pdfBytes = await PdfEngine.generaDocumentoCai();
|
||||
if (pdfBytes.isEmpty) throw Exception("PDF vuoto");
|
||||
final tempDir = await getTemporaryDirectory();
|
||||
final file = File('${tempDir.path}/CID_${DateTime.now().millisecondsSinceEpoch}.pdf');
|
||||
await file.writeAsBytes(pdfBytes, flush: true);
|
||||
Uint8List? anteprima;
|
||||
await for (final page in Printing.raster(Uint8List.fromList(pdfBytes), pages: [0], dpi: 150)) {
|
||||
anteprima = await page.toPng(); break;
|
||||
}
|
||||
if (mounted) {
|
||||
setState(() { _filePdfReale = file; _immagineAnteprima = anteprima; _isLoading = false; });
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _vaiAScambioDati() async {
|
||||
await Navigator.push(context, MaterialPageRoute(builder: (context) => const ScambioDatiScreen()));
|
||||
_verificaStatoPostScambio();
|
||||
}
|
||||
|
||||
void _apriAnteprimaSchermoIntero() {
|
||||
if (!_scambioEffettuato || !_datiPresenti || _immagineAnteprima == null || _filePdfReale == null) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("Dati non pronti!")));
|
||||
return;
|
||||
}
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => ImageViewerScreen(
|
||||
imageBytes: _immagineAnteprima!,
|
||||
pdfFile: _filePdfReale!,
|
||||
isAlreadyApproved: _ioHoApprovato,
|
||||
onConfirmCorrection: _tornaIndietroConPulizia,
|
||||
onConfirmApproval: _ioApprovo
|
||||
)));
|
||||
}
|
||||
|
||||
Future<void> _inviaMailConAllegato(BuildContext context) async {
|
||||
if (_filePdfReale == null) return;
|
||||
try {
|
||||
bool isA = GlobalData.latoCorrente == 'A';
|
||||
String polizzaChiScrive = (isA ? GlobalData.Numero_Polizza_A : GlobalData.Numero_Polizza_B).trim();
|
||||
String targaChiScrive = (isA ? GlobalData.Targa_A : GlobalData.Targa_B).trim();
|
||||
String firmaChiScrive = "${isA ? GlobalData.Nome_contraente_A : GlobalData.Nome_contraente_B} ${isA ? GlobalData.Cognome_contraente_A : GlobalData.Cognome_contraente_B}";
|
||||
String contattoChiScrive = (isA ? GlobalData.N_telefono_mail_contraente_A : GlobalData.N_telefono_mail_contraente_B).trim();
|
||||
|
||||
String compagniaUtente = (isA ? GlobalData.Denominazione_A : GlobalData.Denominazione_B).trim().toUpperCase();
|
||||
String emailDestinatario = "";
|
||||
|
||||
if (GlobalData.assicurazioni.containsKey(compagniaUtente)) {
|
||||
emailDestinatario = GlobalData.assicurazioni[compagniaUtente]!;
|
||||
} else {
|
||||
for (var key in GlobalData.assicurazioni.keys) {
|
||||
if (key.isNotEmpty && (compagniaUtente.contains(key) || key.contains(compagniaUtente))) {
|
||||
emailDestinatario = GlobalData.assicurazioni[key]!;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<String> listaCC = [];
|
||||
if (contattoChiScrive.contains("@")) listaCC.add(contattoChiScrive);
|
||||
|
||||
String oggetto = "DENUNCIA SINISTRO - Polizza n. $polizzaChiScrive - Targa $targaChiScrive";
|
||||
String corpo = "Spett.le Compagnia,\n\n"
|
||||
"Con la presente inoltro in allegato il modulo CAI relativo al sinistro avvenuto in data ${GlobalData.data_incidente} alle ore ${GlobalData.ora} nel comune di ${GlobalData.luogo}.\n\n"
|
||||
"Rimaniamo in attesa dell'apertura del fascicolo.\n\n"
|
||||
"Cordiali saluti,\n$firmaChiScrive\nContatto: $contattoChiScrive";
|
||||
|
||||
final Email email = Email(
|
||||
subject: oggetto,
|
||||
body: corpo,
|
||||
recipients: emailDestinatario.isNotEmpty ? [emailDestinatario] : [],
|
||||
cc: listaCC,
|
||||
attachmentPaths: [_filePdfReale!.path],
|
||||
isHTML: false,
|
||||
);
|
||||
|
||||
await FlutterEmailSender.send(email);
|
||||
} catch (e) {
|
||||
if (mounted) ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("Errore mail: $e")));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _salvaPdfLocale(BuildContext context) async {
|
||||
if (_filePdfReale == null) return;
|
||||
await Share.shareXFiles([XFile(_filePdfReale!.path, mimeType: 'application/pdf')], subject: 'Modulo CAI', text: 'Ecco il modulo CAI compilato.');
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_roomSubscription?.cancel();
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool pdfPronto = !_isLoading && _filePdfReale != null && _immagineAnteprima != null;
|
||||
bool abilitaAnteprima = _scambioEffettuato && _datiPresenti && pdfPronto;
|
||||
bool abilitaFinali = _tuttiHannoApprovato && pdfPronto;
|
||||
|
||||
String testoAnteprima = !_scambioEffettuato ? "2. ANTEPRIMA (Prima fai Scambio)" :
|
||||
(_ioHoApprovato ? "ANTEPRIMA (IN ATTESA...)" : "2. APRI ANTEPRIMA E APPROVA");
|
||||
if (_tuttiHannoApprovato) testoAnteprima = "ANTEPRIMA (COMPLETATA)";
|
||||
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) async {
|
||||
if (didPop) return;
|
||||
if (_ioHoApprovato) _concludiEHome(); else _tornaIndietroConPulizia();
|
||||
},
|
||||
child: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: AppBar(
|
||||
title: const Text("Invio e Salvataggio", style: TextStyle(fontWeight: FontWeight.w800, fontSize: 20)),
|
||||
centerTitle: true,
|
||||
backgroundColor: Colors.blue.shade900.withOpacity(0.95),
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 10,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: _ioHoApprovato ? _concludiEHome : _tornaIndietroConPulizia
|
||||
),
|
||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(bottom: Radius.circular(20))),
|
||||
),
|
||||
body: Stack(children: [
|
||||
Positioned.fill(child: Comp16BackgroundImage()),
|
||||
SafeArea(child: SingleChildScrollView(padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 20), child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
|
||||
|
||||
_buildStatusCard(),
|
||||
|
||||
const SizedBox(height: 20),
|
||||
|
||||
_btn("1. SCAMBIO DATI (QR CODE)", Icons.qr_code_scanner, Colors.orange.shade800, onTap: _vaiAScambioDati, disabled: _ioHoApprovato),
|
||||
|
||||
const SizedBox(height: 20),
|
||||
|
||||
_btn(testoAnteprima, Icons.visibility, _statusColor, onTap: abilitaAnteprima ? _apriAnteprimaSchermoIntero : null, disabled: !abilitaAnteprima),
|
||||
|
||||
const SizedBox(height: 8),
|
||||
Divider(color: Colors.white.withOpacity(0.5), thickness: 1),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
Builder(builder: (ctx) => _btn("SALVA SUL DISPOSITIVO", Icons.save_alt, Colors.green.shade700, onTap: abilitaFinali ? () => _salvaPdfLocale(ctx) : null, disabled: !abilitaFinali)),
|
||||
|
||||
const SizedBox(height: 20),
|
||||
|
||||
Builder(builder: (ctx) => _btn("INVIA ALL'ASSICURAZIONE", Icons.send_rounded, Colors.green.shade700, onTap: abilitaFinali ? () => _inviaMailConAllegato(ctx) : null, disabled: !abilitaFinali)),
|
||||
|
||||
const SizedBox(height: 40),
|
||||
|
||||
_btn(
|
||||
_tuttiHannoApprovato ? "TORNA ALLA HOME" : "CANCELLA TUTTO E ESCI",
|
||||
_tuttiHannoApprovato ? Icons.home : Icons.delete_sweep,
|
||||
_tuttiHannoApprovato ? Colors.green.shade800 : Colors.red.shade900,
|
||||
onTap: _tuttiHannoApprovato ? _concludiEHome : _tornaIndietroConPulizia,
|
||||
disabled: false
|
||||
),
|
||||
|
||||
const SizedBox(height: 30)
|
||||
]))),
|
||||
|
||||
if (_isLoading)
|
||||
Container(color: Colors.black54, child: const Center(child: Column(mainAxisSize: MainAxisSize.min, children: [CircularProgressIndicator(color: Colors.white), SizedBox(height: 20), Text("Elaborazione in corso...", style: TextStyle(color: Colors.white))]))),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _btn(String label, IconData icon, Color color, {VoidCallback? onTap, bool disabled = false}) {
|
||||
bool on = onTap != null && !disabled;
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: on ? [BoxShadow(color: Colors.black.withOpacity(0.3), offset: const Offset(0, 4), blurRadius: 5)] : [],
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed: on ? onTap : null,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: on ? color : Colors.grey,
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
),
|
||||
child: Row(children: [
|
||||
Icon(icon, size: 28), const SizedBox(width: 20),
|
||||
Expanded(child: Text(label, textAlign: TextAlign.center, style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16))),
|
||||
Icon(Icons.lock, size: 20, color: Colors.transparent)
|
||||
])
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatusCard() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(color: Colors.white.withOpacity(0.9), borderRadius: BorderRadius.circular(16), border: Border.all(color: _statusColor, width: 2), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.1), blurRadius: 6, offset: const Offset(0, 3))]),
|
||||
child: Row(children: [
|
||||
Icon(_statusIcon, color: _statusColor, size: 36), const SizedBox(width: 15),
|
||||
Expanded(child: Text(_statusText, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16, color: _statusColor)))
|
||||
])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Widget Sfondo Modificato: Ingrandito (1.3x) e Spostato in basso (+100px)
|
||||
class Comp16BackgroundImage extends StatelessWidget {
|
||||
const Comp16BackgroundImage({super.key});
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: double.infinity,
|
||||
width: double.infinity,
|
||||
color: const Color(0xFFF0F4F8),
|
||||
child: Transform.translate(
|
||||
offset: const Offset(0, 100), // Sposta in basso di 100px
|
||||
child: Transform.scale(
|
||||
scale: 1.3, // Ingrandisce del 30%
|
||||
child: Image.asset(
|
||||
'assets/sfondo_mappa.jpg',
|
||||
fit: BoxFit.cover,
|
||||
alignment: Alignment.center, // Centrale per zoomare uniforme
|
||||
color: const Color(0xFFF0F4F8).withOpacity(0.6),
|
||||
colorBlendMode: BlendMode.lighten,
|
||||
errorBuilder: (c, e, s) => Container(color: Colors.grey.shade200),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ImageViewerScreen extends StatelessWidget {
|
||||
final Uint8List imageBytes;
|
||||
final File pdfFile;
|
||||
final bool isAlreadyApproved;
|
||||
final Function onConfirmCorrection;
|
||||
final Function onConfirmApproval;
|
||||
|
||||
const ImageViewerScreen({super.key, required this.imageBytes, required this.pdfFile, required this.isAlreadyApproved, required this.onConfirmCorrection, required this.onConfirmApproval});
|
||||
|
||||
Future<void> _askCorrection(BuildContext context) async {
|
||||
String titolo = isAlreadyApproved ? "Chiudere?" : "Richiedere correzione?";
|
||||
String testo = isAlreadyApproved
|
||||
? "Hai già approvato. Uscendo tornerai alla schermata precedente in attesa dell'altro utente."
|
||||
: "Questo annullerà lo scambio per entrambi e vi riporterà alla modifica.";
|
||||
String tasto = isAlreadyApproved ? "CHIUDI" : "CORREGGI";
|
||||
|
||||
bool? conf = await showDialog(context: context, builder: (c) => AlertDialog(
|
||||
title: Text(titolo),
|
||||
content: Text(testo),
|
||||
actions: [
|
||||
TextButton(onPressed: () => Navigator.pop(c, false), child: const Text("ANNULLA")),
|
||||
ElevatedButton(onPressed: () => Navigator.pop(c, true), child: Text(tasto))
|
||||
]
|
||||
));
|
||||
if (conf == true) {
|
||||
Navigator.pop(context);
|
||||
if (!isAlreadyApproved) onConfirmCorrection();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _askApproval(BuildContext context) async { Navigator.pop(context); onConfirmApproval(); }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(title: const Text("Verifica Dati"), backgroundColor: Colors.black, foregroundColor: Colors.white),
|
||||
body: Column(children: [
|
||||
Expanded(child: InteractiveViewer(minScale: 0.5, maxScale: 4.0, child: Center(child: Container(color: Colors.white, child: Image.memory(imageBytes, fit: BoxFit.contain))))),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
decoration: BoxDecoration(color: Colors.white, boxShadow: [BoxShadow(color: Colors.black12, blurRadius: 10, offset: const Offset(0, -2))]),
|
||||
child: SafeArea(
|
||||
child: Row(children: [
|
||||
Expanded(
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () => _askCorrection(context),
|
||||
icon: Icon(isAlreadyApproved ? Icons.arrow_back : Icons.edit),
|
||||
label: Text(isAlreadyApproved ? "INDIETRO" : "CORREGGI"),
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.orange.shade800, foregroundColor: Colors.white, padding: const EdgeInsets.symmetric(vertical: 16), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10))),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: isAlreadyApproved ? null : () => _askApproval(context),
|
||||
icon: isAlreadyApproved ? const SizedBox(width: 20, height: 20, child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white)) : const Icon(Icons.check_circle),
|
||||
label: Text(isAlreadyApproved ? "IN ATTESA..." : "APPROVA"),
|
||||
style: ElevatedButton.styleFrom(backgroundColor: isAlreadyApproved ? Colors.grey : Colors.green.shade700, foregroundColor: Colors.white, padding: const EdgeInsets.symmetric(vertical: 16), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10))),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,460 +0,0 @@
|
|||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui' as ui;
|
||||
import 'package:flutter/services.dart' show rootBundle;
|
||||
import 'package:syncfusion_flutter_pdf/pdf.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'global_data.dart';
|
||||
import 'models.dart';
|
||||
import 'cai_mapping.dart';
|
||||
|
||||
class PdfEngine {
|
||||
|
||||
static Future<List<int>> generaDocumentoCai() async {
|
||||
PdfDocument? document;
|
||||
try {
|
||||
final ByteData data = await rootBundle.load('assets/CAI_p1.pdf');
|
||||
|
||||
// 1. Caricamento e Copia
|
||||
final List<int> bytesCopia = data.buffer.asUint8List().toList();
|
||||
document = PdfDocument(inputBytes: bytesCopia);
|
||||
|
||||
final PdfForm form = document.form;
|
||||
final PdfPage page = document.pages[0];
|
||||
|
||||
form.setDefaultAppearance(false);
|
||||
|
||||
// Mappatura
|
||||
Map<String, PdfField> mappaCampi = {};
|
||||
for (int i = 0; i < form.fields.count; i++) {
|
||||
if (form.fields[i].name != null) {
|
||||
mappaCampi[form.fields[i].name!.trim().toUpperCase()] = form.fields[i];
|
||||
}
|
||||
}
|
||||
|
||||
// --- COMPILAZIONE STANDARD (La tua versione preferita) ---
|
||||
|
||||
// 1. TESTI
|
||||
CaiMapping.testi.forEach((keyGlobal, keyPdf) {
|
||||
String valore = _valoreDaGlobal(keyGlobal);
|
||||
String keyPdfNorm = keyPdf.trim().toUpperCase();
|
||||
if (mappaCampi.containsKey(keyPdfNorm) && valore.isNotEmpty) {
|
||||
final field = mappaCampi[keyPdfNorm];
|
||||
if (field is PdfTextBoxField) {
|
||||
field.font = PdfStandardFont(PdfFontFamily.helvetica, 8);
|
||||
field.text = valore.toUpperCase();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 2. CHECKBOX
|
||||
_scriviX(mappaCampi, [GlobalData.feriti ? CaiMapping.feriti_SI : CaiMapping.feriti_NO]);
|
||||
_scriviX(mappaCampi, [GlobalData.Veicoli_danni_materiali_oltre ? CaiMapping.danni_veicoli_SI : CaiMapping.danni_veicoli_NO]);
|
||||
_scriviX(mappaCampi, [GlobalData.Oggetti_diversi_danni_materiali ? CaiMapping.danni_oggetti_SI : CaiMapping.danni_oggetti_NO]);
|
||||
_scriviX(mappaCampi, [GlobalData.FLAG_danni_mat_assicurati_A ? CaiMapping.danni_mat_A_SI : CaiMapping.danni_mat_A_NO]);
|
||||
_scriviX(mappaCampi, [GlobalData.FLAG_danni_mat_assicurati_B ? CaiMapping.danni_mat_B_SI : CaiMapping.danni_mat_B_NO]);
|
||||
|
||||
String catA = GlobalData.Categoria_cond_A.toUpperCase().trim();
|
||||
if (catA == 'A') _scriviX(mappaCampi, ['cat_a_A']);
|
||||
else if (catA == 'B') _scriviX(mappaCampi, ['cat_b_A']);
|
||||
else if (catA.isNotEmpty) _scriviTesto(mappaCampi, ['cat_altro_A'], catA);
|
||||
|
||||
String catB = GlobalData.Categoria_cond_B.toUpperCase().trim();
|
||||
if (catB == 'A') _scriviX(mappaCampi, ['cat_a_B']);
|
||||
else if (catB == 'B') _scriviX(mappaCampi, ['cat_b_B']);
|
||||
else if (catB.isNotEmpty) _scriviTesto(mappaCampi, ['cat_altro_B'], catB);
|
||||
|
||||
// 3. CIRCOSTANZE
|
||||
int countA = 0;
|
||||
int countB = 0;
|
||||
for (int i = 1; i <= 17; i++) {
|
||||
if (GlobalData.circostanzeA[i] == true) {
|
||||
if (_scriviX(mappaCampi, [i < 10 ? "A0$i" : "A$i"])) countA++;
|
||||
}
|
||||
if (GlobalData.circostanzeB[i] == true) {
|
||||
List<String> nomiTarget = [];
|
||||
if (i == 9) nomiTarget = ["Check Box 26", "CheckBox26", "26"];
|
||||
else if (i == 10) nomiTarget = ["Check Box 27", "CheckBox27", "27"];
|
||||
else if (i == 11) nomiTarget = ["Check Box 28", "CheckBox28", "28"];
|
||||
else if (i == 12) nomiTarget = ["Check Box 29", "CheckBox29", "29"];
|
||||
else nomiTarget = [i < 10 ? "B0$i" : "B$i"];
|
||||
if (_scriviX(mappaCampi, nomiTarget)) countB++;
|
||||
}
|
||||
}
|
||||
_scriviTestoTotale(mappaCampi, ['A_TOT', 'A_tot'], countA.toString());
|
||||
_scriviTestoTotale(mappaCampi, ['B_TOT', 'B_tot'], countB.toString());
|
||||
|
||||
// 4. PUNTI URTO
|
||||
for (String punto in GlobalData.puntiUrtoA_List) _scriviXRossa(mappaCampi, [punto]);
|
||||
for (String punto in GlobalData.puntiUrtoB_List) _scriviXRossa(mappaCampi, [punto]);
|
||||
|
||||
// 5. IMMAGINI
|
||||
await _disegnaInBox(page, mappaCampi, CaiMapping.box_grafico,
|
||||
await _renderGraficoV40(GlobalData.tratti.cast<TrattoPenna>().toList(), GlobalData.elementi.cast<ElementoGrafico>().toList()));
|
||||
|
||||
await _disegnaInBox(page, mappaCampi, CaiMapping.box_firma_A, await _renderFirmaTight(GlobalData.puntiFirmaA, Colors.black));
|
||||
await _disegnaInBox(page, mappaCampi, CaiMapping.box_firma_B, await _renderFirmaTight(GlobalData.puntiFirmaB, Colors.black));
|
||||
|
||||
// =================================================================
|
||||
// FASE CRITICA: SALVATAGGIO -> RICARICA -> FLATTEN (Anti-Crash)
|
||||
// =================================================================
|
||||
|
||||
// 1. Salviamo il file compilato in memoria. Questo corregge gli errori interni del PDF.
|
||||
List<int> bytesTemporanei = await document.save();
|
||||
document.dispose(); // Chiudiamo il vecchio
|
||||
|
||||
// 2. Riapriamo il file "pulito"
|
||||
PdfDocument docFinale = PdfDocument(inputBytes: bytesTemporanei);
|
||||
|
||||
// 3. Ora eseguiamo il FLATTEN.
|
||||
// È INDISPENSABILE per vedere le X nell'immagine di anteprima.
|
||||
// Poiché il file è stato appena rigenerato, NON DOVREBBE CRASHARE.
|
||||
try {
|
||||
docFinale.form.flattenAllFields();
|
||||
} catch (e) {
|
||||
debugPrint("⚠️ Errore Flattening anche dopo pulizia: $e");
|
||||
// Se fallisce ancora, usiamo il fallback ReadOnly, ma l'immagine potrebbe essere incompleta.
|
||||
docFinale.form.readOnly = true;
|
||||
}
|
||||
|
||||
// 4. Salvataggio finale
|
||||
List<int> bytesFinali = await docFinale.save();
|
||||
docFinale.dispose();
|
||||
|
||||
return bytesFinali;
|
||||
|
||||
} catch (e) {
|
||||
debugPrint("ERRORE GENERAZIONE PDF: $e");
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
// --- HELPERS (Standard) ---
|
||||
|
||||
static bool _scriviX(Map<String, PdfField> mappa, List<String> nomiPossibili) {
|
||||
for (String nome in nomiPossibili) {
|
||||
String key = nome.trim().toUpperCase();
|
||||
if (mappa.containsKey(key)) {
|
||||
final field = mappa[key]!;
|
||||
if (field is PdfTextBoxField) {
|
||||
field.font = PdfStandardFont(PdfFontFamily.helvetica, 14);
|
||||
field.foreColor = PdfColor(0, 0, 0);
|
||||
field.text = "X";
|
||||
} else if (field is PdfCheckBoxField) {
|
||||
field.isChecked = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void _scriviTesto(Map<String, PdfField> mappa, List<String> nomiPossibili, String testo) {
|
||||
for (String nome in nomiPossibili) {
|
||||
String key = nome.trim().toUpperCase();
|
||||
if (mappa.containsKey(key)) {
|
||||
final field = mappa[key]!;
|
||||
if (field is PdfTextBoxField) {
|
||||
field.font = PdfStandardFont(PdfFontFamily.helvetica, 10);
|
||||
field.foreColor = PdfColor(0, 0, 0);
|
||||
field.text = testo;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool _scriviXRossa(Map<String, PdfField> mappa, List<String> nomiPossibili) {
|
||||
for (String nome in nomiPossibili) {
|
||||
String key = nome.trim().toUpperCase();
|
||||
if (mappa.containsKey(key)) {
|
||||
final field = mappa[key]!;
|
||||
if (field is PdfTextBoxField) {
|
||||
field.font = PdfStandardFont(PdfFontFamily.helvetica, 16, style: PdfFontStyle.bold);
|
||||
field.foreColor = PdfColor(255, 0, 0);
|
||||
field.text = "X";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void _scriviTestoTotale(Map<String, PdfField> mappa, List<String> nomi, String testo) {
|
||||
for (String nome in nomi) {
|
||||
String key = nome.trim().toUpperCase();
|
||||
if (mappa.containsKey(key)) {
|
||||
final field = mappa[key]!;
|
||||
if (field is PdfTextBoxField) {
|
||||
field.font = PdfStandardFont(PdfFontFamily.helvetica, 8);
|
||||
field.textAlignment = PdfTextAlignment.center;
|
||||
field.text = testo;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> _disegnaInBox(PdfPage page, Map<String, PdfField> mappa, String nomeCampo, Uint8List? imgBytes) async {
|
||||
String key = nomeCampo.trim().toUpperCase();
|
||||
if (imgBytes == null || !mappa.containsKey(key)) return;
|
||||
Rect boxRect = mappa[key]!.bounds;
|
||||
PdfBitmap bitmap = PdfBitmap(imgBytes);
|
||||
double imageW = bitmap.width.toDouble();
|
||||
double imageH = bitmap.height.toDouble();
|
||||
if (imageW <= 0 || imageH <= 0) return;
|
||||
double ratioX = boxRect.width / imageW;
|
||||
double ratioY = boxRect.height / imageH;
|
||||
double scale = (ratioX < ratioY) ? ratioX : ratioY;
|
||||
double drawW = imageW * scale;
|
||||
double drawH = imageH * scale;
|
||||
double offsetX = boxRect.left + (boxRect.width - drawW) / 2;
|
||||
double offsetY = boxRect.top + (boxRect.height - drawH) / 2;
|
||||
page.graphics.drawImage(bitmap, Rect.fromLTWH(offsetX, offsetY, drawW, drawH));
|
||||
}
|
||||
|
||||
static Future<Uint8List?> _renderFirmaTight(List<Offset?> punti, Color colore) async {
|
||||
if (punti.isEmpty) return null;
|
||||
double minX = double.infinity, minY = double.infinity, maxX = double.negativeInfinity, maxY = double.negativeInfinity;
|
||||
for (var p in punti) { if (p != null) { if (p.dx < minX) minX = p.dx; if (p.dx > maxX) maxX = p.dx; if (p.dy < minY) minY = p.dy; if (p.dy > maxY) maxY = p.dy; } }
|
||||
double padding = 20.0;
|
||||
double firmaW = maxX - minX;
|
||||
double firmaH = maxY - minY;
|
||||
if (firmaW <= 0) firmaW = 1; if (firmaH <= 0) firmaH = 1;
|
||||
double resolutionScale = 3.0;
|
||||
double canvasW = (firmaW + padding * 2) * resolutionScale;
|
||||
double canvasH = (firmaH + padding * 2) * resolutionScale;
|
||||
final recorder = ui.PictureRecorder();
|
||||
final canvas = Canvas(recorder);
|
||||
canvas.scale(resolutionScale);
|
||||
canvas.translate(-minX + padding, -minY + padding);
|
||||
final paint = Paint()..color = colore..strokeWidth = 5.0..style = PaintingStyle.stroke..strokeCap = StrokeCap.round..strokeJoin = StrokeJoin.round;
|
||||
for (int i = 0; i < punti.length - 1; i++) { if (punti[i] != null && punti[i+1] != null) { canvas.drawLine(punti[i]!, punti[i+1]!, paint); } }
|
||||
final img = await recorder.endRecording().toImage(canvasW.toInt(), canvasH.toInt());
|
||||
final byteData = await img.toByteData(format: ui.ImageByteFormat.png);
|
||||
return byteData?.buffer.asUint8List();
|
||||
}
|
||||
|
||||
static Future<Uint8List?> _renderGraficoV40(List<TrattoPenna> tratti, List<ElementoGrafico> elementi) async {
|
||||
final recorder = ui.PictureRecorder();
|
||||
final canvas = Canvas(recorder);
|
||||
final size = const Size(2000, 800);
|
||||
final painter = PainterV40(tratti, elementi);
|
||||
painter.paint(canvas, size);
|
||||
final img = await recorder.endRecording().toImage(size.width.toInt(), size.height.toInt());
|
||||
final byteData = await img.toByteData(format: ui.ImageByteFormat.png);
|
||||
return byteData?.buffer.asUint8List();
|
||||
}
|
||||
|
||||
static String _valoreDaGlobal(String key) {
|
||||
switch (key) {
|
||||
case 'data_incidente': return GlobalData.data_incidente;
|
||||
case 'ora': return GlobalData.ora;
|
||||
case 'luogo': return GlobalData.luogo;
|
||||
case 'testimoni': return GlobalData.testimoni;
|
||||
case 'danni_visibili_A': return GlobalData.danni_visibili_A;
|
||||
case 'osservazioni_A': return GlobalData.osservazioni_A;
|
||||
case 'danni_visibili_B': return GlobalData.danni_visibili_B;
|
||||
case 'osservazioni_B': return GlobalData.osservazioni_B;
|
||||
case 'Cognome_contraente_A': return GlobalData.Cognome_contraente_A;
|
||||
case 'Nome_contraente_A': return GlobalData.Nome_contraente_A;
|
||||
case 'Codice_Fiscale_contraente_A': return GlobalData.Codice_Fiscale_contraente_A;
|
||||
case 'Indirizzo_contraente_A': return GlobalData.Indirizzo_contraente_A;
|
||||
case 'CAP_contraente_A': return GlobalData.CAP_contraente_A;
|
||||
case 'Stato_contraente_A': return GlobalData.Stato_contraente_A;
|
||||
case 'N_telefono_mail_contraente_A': return GlobalData.N_telefono_mail_contraente_A;
|
||||
case 'Marca_e_Tipo_A': return GlobalData.Marca_e_Tipo_A;
|
||||
case 'Targa_A': return GlobalData.Targa_A;
|
||||
case 'Stato_immatricolazione_A': return GlobalData.Stato_immatricolazione_A;
|
||||
case 'Rimorchio_A': return GlobalData.Rimorchio_A;
|
||||
case 'Stato_immatricolazione2_A': return GlobalData.Stato_immatricolazione2_A;
|
||||
case 'Denominazione_A': return GlobalData.Denominazione_A;
|
||||
case 'Numero_Polizza_A': return GlobalData.Numero_Polizza_A;
|
||||
case 'N_carta_verde_A': return GlobalData.N_carta_verde_A;
|
||||
case 'Data_Inizio_Dal_A': return GlobalData.Data_Inizio_Dal_A;
|
||||
case 'Data_Scadenza_Al_A': return GlobalData.Data_Scadenza_Al_A;
|
||||
case 'Agenzia_A': return GlobalData.Agenzia_A;
|
||||
case 'Indirizzo_agenzia_A': return GlobalData.Indirizzo_agenzia_A;
|
||||
case 'Stato_agenzia_A': return GlobalData.Stato_agenzia_A;
|
||||
case 'Denominazione_agenzia_A': return GlobalData.Denominazione_agenzia_A;
|
||||
case 'N_tel_mail_agenzia_A': return GlobalData.N_tel_mail_agenzia_A;
|
||||
case 'Cognome_cond_A': return GlobalData.Cognome_cond_A;
|
||||
case 'Nome_cond_A': return GlobalData.Nome_cond_A;
|
||||
case 'Data_nascita_cond_A': return GlobalData.Data_nascita_cond_A;
|
||||
case 'Cod_fiscale_cond_A': return GlobalData.Cod_fiscale_cond_A;
|
||||
case 'Indirizzo_cond_A': return GlobalData.Indirizzo_cond_A;
|
||||
case 'Stato_cond_A': return GlobalData.Stato_cond_A;
|
||||
case 'N_tel_mail_cond_A': return GlobalData.N_tel_mail_cond_A;
|
||||
case 'N_Patente_cond_A': return GlobalData.N_Patente_cond_A;
|
||||
case 'Scadenza_cond_A': return GlobalData.Scadenza_cond_A;
|
||||
case 'Cognome_contraente_B': return GlobalData.Cognome_contraente_B;
|
||||
case 'Nome_contraente_B': return GlobalData.Nome_contraente_B;
|
||||
case 'Codice_Fiscale_contraente_B': return GlobalData.Codice_Fiscale_contraente_B;
|
||||
case 'Indirizzo_contraente_B': return GlobalData.Indirizzo_contraente_B;
|
||||
case 'CAP_contraente_B': return GlobalData.CAP_contraente_B;
|
||||
case 'Stato_contraente_B': return GlobalData.Stato_contraente_B;
|
||||
case 'N_telefono_mail_contraente_B': return GlobalData.N_telefono_mail_contraente_B;
|
||||
case 'Marca_e_Tipo_B': return GlobalData.Marca_e_Tipo_B;
|
||||
case 'Targa_B': return GlobalData.Targa_B;
|
||||
case 'Stato_immatricolazione_B': return GlobalData.Stato_immatricolazione_B;
|
||||
case 'Rimorchio_B': return GlobalData.Rimorchio_B;
|
||||
case 'Stato_immatricolazione2_B': return GlobalData.Stato_immatricolazione2_B;
|
||||
case 'Denominazione_B': return GlobalData.Denominazione_B;
|
||||
case 'Numero_Polizza_B': return GlobalData.Numero_Polizza_B;
|
||||
case 'N_carta_verde_B': return GlobalData.N_carta_verde_B;
|
||||
case 'Data_Inizio_Dal_B': return GlobalData.Data_Inizio_Dal_B;
|
||||
case 'Data_Scadenza_Al_B': return GlobalData.Data_Scadenza_Al_B;
|
||||
case 'Agenzia_B': return GlobalData.Agenzia_B;
|
||||
case 'Indirizzo_agenzia_B': return GlobalData.Indirizzo_agenzia_B;
|
||||
case 'Stato_agenzia_B': return GlobalData.Stato_agenzia_B;
|
||||
case 'Denominazione_agenzia_B': return GlobalData.Denominazione_agenzia_B;
|
||||
case 'N_tel_mail_agenzia_B': return GlobalData.N_tel_mail_agenzia_B;
|
||||
case 'Cognome_cond_B': return GlobalData.Cognome_cond_B;
|
||||
case 'Nome_cond_B': return GlobalData.Nome_cond_B;
|
||||
case 'Data_nascita_cond_B': return GlobalData.Data_nascita_cond_B;
|
||||
case 'Cod_fiscale_cond_B': return GlobalData.Cod_fiscale_cond_B;
|
||||
case 'Indirizzo_cond_B': return GlobalData.Indirizzo_cond_B;
|
||||
case 'Stato_cond_B': return GlobalData.Stato_cond_B;
|
||||
case 'N_tel_mail_cond_B': return GlobalData.N_tel_mail_cond_B;
|
||||
case 'N_Patente_cond_B': return GlobalData.N_Patente_cond_B;
|
||||
case 'Scadenza_cond_B': return GlobalData.Scadenza_cond_B;
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PainterV40 extends CustomPainter {
|
||||
final List<TrattoPenna> tr;
|
||||
final List<ElementoGrafico> el;
|
||||
|
||||
PainterV40(this.tr, this.el);
|
||||
|
||||
final List<Color> palette = [Colors.blue, Colors.orange, Colors.green, Colors.purple, Colors.red];
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
// 1. SFONDO BIANCO (Risolve il problema del nero)
|
||||
final Paint backgroundPaint = Paint()..color = Colors.white;
|
||||
canvas.drawRect(Rect.fromLTWH(0, 0, size.width, size.height), backgroundPaint);
|
||||
|
||||
// 2. DISEGNO GRIGLIA (Opzionale, ma rende il disegno professionale come l'originale)
|
||||
final Paint gridPaint = Paint()
|
||||
..color = Colors.grey.shade300
|
||||
..strokeWidth = 2.0;
|
||||
|
||||
double step = 40.0; // Dimensione quadretti
|
||||
// Linee verticali
|
||||
for (double x = 0; x <= size.width; x += step) {
|
||||
canvas.drawLine(Offset(x, 0), Offset(x, size.height), gridPaint);
|
||||
}
|
||||
// Linee orizzontali
|
||||
for (double y = 0; y <= size.height; y += step) {
|
||||
canvas.drawLine(Offset(0, y), Offset(size.width, y), gridPaint);
|
||||
}
|
||||
|
||||
// Se non ci sono tratti o elementi, ci fermiamo qui (abbiamo disegnato solo sfondo e griglia pulita)
|
||||
if (tr.isEmpty && el.isEmpty) return;
|
||||
|
||||
// --- CALCOLO BOUNDING BOX PER IL CONTENUTO ---
|
||||
double minX = double.infinity, minY = double.infinity;
|
||||
double maxX = double.negativeInfinity, maxY = double.negativeInfinity;
|
||||
|
||||
for (var t in tr) {
|
||||
for (var p in t.punti) {
|
||||
if (p.dx < minX) minX = p.dx;
|
||||
if (p.dx > maxX) maxX = p.dx;
|
||||
if (p.dy < minY) minY = p.dy;
|
||||
if (p.dy > maxY) maxY = p.dy;
|
||||
}
|
||||
}
|
||||
for (var e in el) {
|
||||
if (e.posizione.dx - 30 < minX) minX = e.posizione.dx - 30;
|
||||
if (e.posizione.dx + 30 > maxX) maxX = e.posizione.dx + 30;
|
||||
if (e.posizione.dy - 30 < minY) minY = e.posizione.dy - 30;
|
||||
if (e.posizione.dy + 30 > maxY) maxY = e.posizione.dy + 30;
|
||||
}
|
||||
|
||||
// Se non abbiamo trovato nulla (caso raro), usiamo valori di default
|
||||
if (minX == double.infinity) { minX = 0; maxX = 100; minY = 0; maxY = 100; }
|
||||
|
||||
double padding = 40.0;
|
||||
double drawingW = maxX - minX + (padding * 2);
|
||||
double drawingH = maxY - minY + (padding * 2);
|
||||
|
||||
if (drawingW <= 0) drawingW = 100;
|
||||
if (drawingH <= 0) drawingH = 100;
|
||||
|
||||
// Scala per adattare il disegno al box (Contain)
|
||||
double scaleX = size.width / drawingW;
|
||||
double scaleY = size.height / drawingH;
|
||||
double scale = (scaleX < scaleY) ? scaleX : scaleY;
|
||||
|
||||
// Centratura
|
||||
double offsetX = (size.width - (drawingW * scale)) / 2;
|
||||
double offsetY = (size.height - (drawingH * scale)) / 2;
|
||||
|
||||
canvas.save();
|
||||
canvas.translate(offsetX, offsetY);
|
||||
canvas.scale(scale);
|
||||
canvas.translate(-minX + padding, -minY + padding);
|
||||
|
||||
// --- DISEGNO STRADE E FRECCE ---
|
||||
Paint pStrada = Paint()
|
||||
..color = Colors.black
|
||||
..strokeWidth = 4.0 / scale
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeCap = StrokeCap.round;
|
||||
|
||||
for (var t in tr) {
|
||||
if (t.punti.length > 1) {
|
||||
Path path = Path()..moveTo(t.punti[0].dx, t.punti[0].dy);
|
||||
for (var pt in t.punti) path.lineTo(pt.dx, pt.dy);
|
||||
canvas.drawPath(path, pStrada);
|
||||
|
||||
if (t.tipo == 'freccia') {
|
||||
double a = (t.punti.last - t.punti[t.punti.length - 2]).direction;
|
||||
canvas.drawLine(t.punti.last, t.punti.last - Offset.fromDirection(a - 0.5, 15), pStrada);
|
||||
canvas.drawLine(t.punti.last, t.punti.last - Offset.fromDirection(a + 0.5, 15), pStrada);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- DISEGNO AUTO E TESTI ---
|
||||
for (var e in el) {
|
||||
canvas.save();
|
||||
canvas.translate(e.posizione.dx, e.posizione.dy);
|
||||
canvas.rotate(e.rotazione);
|
||||
|
||||
if (e.tipo == 'testo') {
|
||||
final tp = TextPainter(
|
||||
text: TextSpan(text: e.label ?? "", style: const TextStyle(color: Colors.black, fontSize: 24, fontWeight: FontWeight.bold)),
|
||||
textDirection: TextDirection.ltr
|
||||
)..layout();
|
||||
tp.paint(canvas, Offset(-tp.width/2, -tp.height/2));
|
||||
}
|
||||
else if (e.tipo.startsWith('auto')) {
|
||||
int idx = ((e.label ?? "A").codeUnitAt(0) - 65) % palette.length;
|
||||
Paint p = Paint()..color = palette[idx];
|
||||
|
||||
// Corpo auto colorato
|
||||
canvas.drawRect(Rect.fromCenter(center: Offset.zero, width: 60, height: 30), p);
|
||||
// Bordo auto nero
|
||||
canvas.drawRect(Rect.fromCenter(center: Offset.zero, width: 60, height: 30), Paint()..style=PaintingStyle.stroke..color=Colors.black..strokeWidth=2);
|
||||
|
||||
// Lettera A/B Bianca
|
||||
final tp = TextPainter(
|
||||
text: TextSpan(text: e.label ?? "A", style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 20)),
|
||||
textDirection: TextDirection.ltr
|
||||
)..layout();
|
||||
tp.paint(canvas, Offset(-tp.width/2, -tp.height/2));
|
||||
}
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
|
||||
}
|
||||
|
|
@ -30,6 +30,8 @@ class _TestScrapingPageState extends State<TestScrapingPage> {
|
|||
|
||||
// 2. Quando torni indietro, se c'è un risultato, mostralo
|
||||
if (dataScadenza != null) {
|
||||
if (!mounted) return; // FIX: Prevents crash if widget is disposed
|
||||
|
||||
setState(() {
|
||||
_risultato = "Scadenza trovata: $dataScadenza";
|
||||
});
|
||||
|
|
|
|||
1545
macos/Podfile.lock
Normal file
1545
macos/Podfile.lock
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -21,12 +21,14 @@
|
|||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
31413C520E15A7673CFC603D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34405923603C6F3E98233D00 /* Pods_Runner.framework */; };
|
||||
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };
|
||||
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
|
||||
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
|
||||
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
||||
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
||||
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
||||
A5D131E02F1E949FC4815A8C /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F134AE522A68CD530E418735 /* Pods_RunnerTests.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
|
@ -60,11 +62,15 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0366A53ED0800931FFF41AE5 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
0D3C2196A718EBA91A7C8100 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
148A4411504173E5F35C74C7 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
1A1BEB320B24F77667957274 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
|
||||
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
|
||||
33CC10ED2044A3C60003C045 /* cid_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cid_app.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
33CC10ED2044A3C60003C045 /* cid_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = cid_app.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
|
||||
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
|
|
@ -76,8 +82,12 @@
|
|||
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
||||
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
||||
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
||||
34405923603C6F3E98233D00 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
589C2BD6703BC443C8FA035E /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
||||
D6C31197BF70BC6B5CD00B9A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
F134AE522A68CD530E418735 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
|
@ -85,6 +95,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A5D131E02F1E949FC4815A8C /* Pods_RunnerTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
@ -92,6 +103,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
31413C520E15A7673CFC603D /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
@ -125,6 +137,7 @@
|
|||
331C80D6294CF71000263BE5 /* RunnerTests */,
|
||||
33CC10EE2044A3C60003C045 /* Products */,
|
||||
D73912EC22F37F3D000D13A0 /* Frameworks */,
|
||||
66EE340F1F1D3AD8EE634A5B /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
|
|
@ -172,9 +185,25 @@
|
|||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
66EE340F1F1D3AD8EE634A5B /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D6C31197BF70BC6B5CD00B9A /* Pods-Runner.debug.xcconfig */,
|
||||
0D3C2196A718EBA91A7C8100 /* Pods-Runner.release.xcconfig */,
|
||||
1A1BEB320B24F77667957274 /* Pods-Runner.profile.xcconfig */,
|
||||
0366A53ED0800931FFF41AE5 /* Pods-RunnerTests.debug.xcconfig */,
|
||||
589C2BD6703BC443C8FA035E /* Pods-RunnerTests.release.xcconfig */,
|
||||
148A4411504173E5F35C74C7 /* Pods-RunnerTests.profile.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
34405923603C6F3E98233D00 /* Pods_Runner.framework */,
|
||||
F134AE522A68CD530E418735 /* Pods_RunnerTests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -186,6 +215,7 @@
|
|||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||
buildPhases = (
|
||||
3BFA64D3161BEB26B02C0F87 /* [CP] Check Pods Manifest.lock */,
|
||||
331C80D1294CF70F00263BE5 /* Sources */,
|
||||
331C80D2294CF70F00263BE5 /* Frameworks */,
|
||||
331C80D3294CF70F00263BE5 /* Resources */,
|
||||
|
|
@ -204,11 +234,13 @@
|
|||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
718D3F2DEBA556596AD46B48 /* [CP] Check Pods Manifest.lock */,
|
||||
33CC10E92044A3C60003C045 /* Sources */,
|
||||
33CC10EA2044A3C60003C045 /* Frameworks */,
|
||||
33CC10EB2044A3C60003C045 /* Resources */,
|
||||
33CC110E2044A8840003C045 /* Bundle Framework */,
|
||||
3399D490228B24CF009A79C7 /* ShellScript */,
|
||||
530AFF80577A3C708A569F48 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
|
|
@ -329,6 +361,67 @@
|
|||
shellPath = /bin/sh;
|
||||
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
|
||||
};
|
||||
3BFA64D3161BEB26B02C0F87 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
530AFF80577A3C708A569F48 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
718D3F2DEBA556596AD46B48 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
|
|
@ -380,6 +473,7 @@
|
|||
/* Begin XCBuildConfiguration section */
|
||||
331C80DB294CF71000263BE5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 0366A53ED0800931FFF41AE5 /* Pods-RunnerTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
|
|
@ -394,6 +488,7 @@
|
|||
};
|
||||
331C80DC294CF71000263BE5 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 589C2BD6703BC443C8FA035E /* Pods-RunnerTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
|
|
@ -408,6 +503,7 @@
|
|||
};
|
||||
331C80DD294CF71000263BE5 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 148A4411504173E5F35C74C7 /* Pods-RunnerTests.profile.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
|
|
|
|||
|
|
@ -4,4 +4,7 @@
|
|||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
|
|||
9
memory-bank/change-log.md
Normal file
9
memory-bank/change-log.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Change Log
|
||||
|
||||
- **2026-04-24**: Sostituiti tutti i metodi deprecati `.withOpacity(...)` con `.withValues(alpha: ...)` in 12 file dell'app, rimuovendo 36 avvisi dal compilatore Dart.
|
||||
- **2026-04-24**: Rimossa la cartella deprecata `lib/temp/` per pulire l'analizzatore Dart da oltre 350 falsi errori. Aggiunto controllo `if (!mounted) return;` in `lib/test_scraping.dart` per prevenire crash asincroni.
|
||||
- **2026-04-24**: Creazione iniziale della Memory Bank.
|
||||
- **2026-04-24**: Implementata la funzione statica `fixCircostanze` in `cid_data_manager.dart` per risolvere un bug critico di deserializzazione da Firebase (List vs Map) durante lo scambio dati.
|
||||
- **2026-04-22**: Release (v_20260422_150000) Auto-sync su git main.
|
||||
- **2026-03-24**: Release (v_20260324_125426) Auto-sync.
|
||||
- **2026-03-23**: Release (v_20260323_020000) Auto-sync.
|
||||
13
memory-bank/current-state.md
Normal file
13
memory-bank/current-state.md
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Current State
|
||||
|
||||
L'app "CAI Facile" è in uno stato avanzato di sviluppo. Lo scambio dati remoto e la generazione PDF sono attivi.
|
||||
|
||||
## Funzionalità Implementate
|
||||
- UI/UX completa per le sezioni 1-15 del modulo CID.
|
||||
- Autocompilazione del luogo dell'incidente tramite `geolocator` e `geocoding`.
|
||||
- Scambio Dati P2P sicuro tramite Firebase (Host/Guest via QR).
|
||||
- Generazione PDF e condivisione.
|
||||
- Parsing dati protetto (`fixCircostanze`).
|
||||
|
||||
## Problemi Aperti / TODO
|
||||
- **Debito Tecnico**: Sono presenti variabili non formattate in `lowerCamelCase` all'interno di `lib/global_data.dart` (es. `Cod_fiscale_cond_B`).
|
||||
15
memory-bank/decisions.md
Normal file
15
memory-bank/decisions.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Decisions & Architecture
|
||||
|
||||
## Gestione Firebase Sync e Tipizzazione
|
||||
- **Problema**: Firebase trasforma dizionari con chiavi numeriche sequenziali (come le 17 circostanze del CID) in List, causando crash a runtime.
|
||||
- **Soluzione**: Introdotta e adottata la funzione helper `fixCircostanze` in `CidDataManager` per fare un parsing dinamico sicuro sia da List che da Map.
|
||||
|
||||
## Coordinate PDF
|
||||
- **Decisione (Blindata)**: Il motore PDF utilizza un posizionamento assoluto (`pw.Stack`) con coordinate fisse (es. Box 12 Y=575.0, Font 8pt Bold) per garantire una stampa pixel-perfect identica al modulo cartaceo ufficiale. Non rompere mai il layout per testo in overflow.
|
||||
|
||||
## Mappatura Payload
|
||||
- Si utilizzano nomi brevi (minificati) per il payload JSON (es. `cog` per Cognome, `cf` per Codice Fiscale, `circ` per Circostanze) per ridurre le dimensioni dei pacchetti e ottimizzare i codici QR.
|
||||
|
||||
## Sincronizzazione Dati Condivisi
|
||||
- Il "Cassetto 1" (Grafico Incidente con auto e strade) viene gestito **esclusivamente dal Conducente A** e sincronizzato in sovrascrittura su B per evitare conflitti logici.
|
||||
- Le Firme ("Cassetto 2") restano indipendenti (A non sovrascrive B).
|
||||
14
memory-bank/identity.md
Normal file
14
memory-bank/identity.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Identity
|
||||
|
||||
User OS: macOS
|
||||
App Data Directory: /Users/paolo/.gemini/antigravity
|
||||
|
||||
## Project
|
||||
Name: CAI Facile (cid_app)
|
||||
Type: App mobile Flutter (iOS & Android) per la compilazione della costatazione amichevole di incidente (CID).
|
||||
Path: /Volumes/NVME-2TB/Sviluppo/development/cid_app
|
||||
|
||||
## Preferences
|
||||
- Language: Italian
|
||||
- Documentation: Markdown-based memory bank
|
||||
- Style: Proactive, rigorous, update documentation actively before/after changes.
|
||||
9
memory-bank/project.md
Normal file
9
memory-bank/project.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# CAI Facile - Project Overview
|
||||
|
||||
Applicazione Flutter per la compilazione assistita del modulo CAI/CID (Constatazione Amichevole di Incidente) digitale, pensata per guidare gli automobilisti nel momento stressante post-incidente.
|
||||
|
||||
## Caratteristiche Principali
|
||||
- **Generazione PDF**: Creazione del documento PDF ufficiale (stile CAI standard) con coordinate millimetriche perfette per l'allineamento dei testi sui box prestampati.
|
||||
- **Scambio Dati Real-Time**: Possibilità di condividere e sincronizzare il modulo tra due smartphone tramite QRCode e sessioni cloud Firebase ("Lato A" e "Lato B").
|
||||
- **Firma Digitale e Disegno Danni**: Strumenti per disegnare a mano libera i punti di urto sulle auto e raccogliere le firme legali dei conducenti.
|
||||
- **Integrazioni Hardware**: Acquisizione automatica del luogo tramite GPS (geocoding) e scansione OCR di documenti/QR per un data-entry veloce.
|
||||
13
memory-bank/resources.md
Normal file
13
memory-bank/resources.md
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Resources
|
||||
|
||||
## Core Technologies
|
||||
- **Flutter SDK**: >=3.10.0 <4.0.0
|
||||
- **Motore PDF**: `syncfusion_flutter_pdf`, `pdf`, `printing`
|
||||
- **Backend & Sincronizzazione**: `firebase_core`, `cloud_firestore`, `firebase_database`, `firebase_auth`
|
||||
- **Geolocalizzazione**: `geolocator`, `geocoding`
|
||||
- **Hardware & OCR**: `camera`, `google_mlkit_text_recognition`, `qr_flutter`, `mobile_scanner`
|
||||
- **Grafica & UI**: `signature`, `image`
|
||||
|
||||
## Documentazione Interna
|
||||
- `PROGETTO_CID_KB.md`: Knowledge base originale contenente regole architetturali e mappatura del database JSON.
|
||||
- `cai_facile_memory.txt`: Backup esteso del progetto e vecchi snapshot.
|
||||
Loading…
Reference in a new issue