j
This commit is contained in:
@@ -107,13 +107,15 @@ class _TicketFormScreenState extends State<TicketFormScreen> {
|
||||
// 2. Sincronizziamo i testi scritti a mano nel Cubit
|
||||
_flushControllersToCubit();
|
||||
|
||||
final attachmentsBloc = context.read<AttachmentsBloc>();
|
||||
|
||||
// 3. Facciamo il salvataggio silenzioso
|
||||
final newId = await context.read<TicketFormCubit>().saveTicketDraft();
|
||||
|
||||
if (newId != null && context.mounted) {
|
||||
// 4. IL TOCCO DI CLASSE: Diciamo all'AttachmentsBloc che ora la pratica ha un ID!
|
||||
// Questo farà partire l'upload automatico di eventuali file "in bozza"
|
||||
context.read<AttachmentsBloc>().add(ParentEntitySavedEvent(newId));
|
||||
attachmentsBloc.add(ParentEntitySavedEvent(newId));
|
||||
}
|
||||
|
||||
return newId;
|
||||
|
||||
Reference in New Issue
Block a user