This commit is contained in:
2026-05-07 19:29:39 +02:00
parent fbf18acf05
commit 9793ba8348
3 changed files with 49 additions and 49 deletions

View File

@@ -194,6 +194,8 @@ class AppRouter {
GetIt.I.get<SessionCubit>().state.currentStore!.id!,
);
context.read<CustomersCubit>().loadCustomers();
context.read<ProductsCubit>().loadModels();
context.read<ProductsCubit>().loadBrands();
return MultiBlocProvider(
providers: [
@@ -230,28 +232,15 @@ class AppRouter {
);
},
),
/* GoRoute(
path: '/customer/:id/upload',
builder: (context, state) {
final customerId = state.pathParameters['id']!;
final customerName = state.uri.queryParameters['name'] ?? 'Cliente';
return BlocProvider(
create: (context) => AttachmentsBloc(
parentType: AttachmentParentType.customer,
parentId: customerId,
),
child: SharedMobileUploadScreen(
title: 'Aggiungi allegati al cliente $customerName',
),
);
},
), */
GoRoute(
path: '/operation-form',
path: '/operations/form/:id',
name: 'operation-form',
builder: (context, state) {
final existingOperation = state.extra as OperationModel?;
final operationId = state.uri.queryParameters['operationId'];
final String pathId = state.pathParameters['id'] ?? 'new';
final OperationModel? operationFromExtra =
state.extra as OperationModel?;
final String? realOperationId = pathId == 'new' ? null : pathId;
final currentStoreId = GetIt.I
.get<SessionCubit>()
.state
@@ -267,7 +256,7 @@ class AppRouter {
return BlocProvider(
create: (context) => AttachmentsBloc(
parentId: operationId ?? existingOperation?.id,
parentId: realOperationId,
parentType: AttachmentParentType.operation,
),
child: OperationFormScreen(
@@ -277,35 +266,7 @@ class AppRouter {
);
},
),
/* GoRoute(
path: '/operation/:id/upload',
builder: (context, state) {
final operationId = state.pathParameters['id']!;
final operationName =
state.uri.queryParameters['name'] ?? 'Pratica';
final currentStoreId = GetIt.I
.get<SessionCubit>()
.state
.currentStore!
.id!;
context.read<CustomersCubit>().loadCustomers();
context.read<ProvidersCubit>().loadActiveProvidersForStore(
currentStoreId,
);
context.read<ProductsCubit>().loadModels();
context.read<ProductsCubit>().loadBrands();
context.read<StaffCubit>().loadStaffForStore(currentStoreId);
return BlocProvider(
create: (context) => AttachmentsBloc(
parentId: operationId,
parentType: AttachmentParentType.operation,
),
child: SharedMobileUploadScreen(
title: 'Aggiungi allegati alla pratica $operationName',
),
);
},
), */
GoRoute(
path: '/upload/:type/:id',
builder: (context, state) {