This commit is contained in:
2026-05-07 13:28:41 +02:00
parent c8d6d4470c
commit 0af51aae10
7 changed files with 164 additions and 33 deletions

View File

@@ -208,7 +208,7 @@ class AppRouter {
);
},
),
GoRoute(
/* GoRoute(
path: '/customer/:id/upload',
builder: (context, state) {
final customerId = state.pathParameters['id']!;
@@ -223,7 +223,7 @@ class AppRouter {
),
);
},
),
), */
GoRoute(
path: '/operation-form',
name: 'operation-form',
@@ -255,7 +255,7 @@ class AppRouter {
);
},
),
GoRoute(
/* GoRoute(
path: '/operation/:id/upload',
builder: (context, state) {
final operationId = state.pathParameters['id']!;
@@ -283,6 +283,29 @@ class AppRouter {
),
);
},
), */
GoRoute(
path: '/upload/:type/:id',
builder: (context, state) {
final typeString = state.pathParameters['type']!;
final id = state.pathParameters['id']!;
// Trasformiamo la stringa dell'URL nel nostro amato Enum!
final parentType = AttachmentParentType.values.firstWhere(
(e) => e.name == typeString,
orElse: () =>
AttachmentParentType.ticket, // Fallback di sicurezza
);
// Creiamo il BLoC "al volo" solo per questa schermata
return BlocProvider(
create: (context) =>
AttachmentsBloc(parentId: id, parentType: parentType),
child: const SharedMobileUploadScreen(
title: 'Caricamento Rapido',
),
);
},
),
],
);