fg
This commit is contained in:
@@ -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',
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user