fix routing
This commit is contained in:
@@ -137,8 +137,8 @@ class _LatestOperationsCardContent extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => context.pushNamed(
|
onTap: () => context.pushNamed(
|
||||||
Routes.operationForm,
|
Routes.operationForm,
|
||||||
|
extra: (createdBy: null, operation: operation),
|
||||||
pathParameters: {'id': operation.id!},
|
pathParameters: {'id': operation.id!},
|
||||||
extra: operation,
|
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
|
|||||||
@@ -169,12 +169,9 @@ class _OperationListScreenState extends State<OperationListScreen> {
|
|||||||
),
|
),
|
||||||
trailing: const Icon(Icons.chevron_right),
|
trailing: const Icon(Icons.chevron_right),
|
||||||
onTap: () => context.pushNamed(
|
onTap: () => context.pushNamed(
|
||||||
'operations/form/id=${operation.id}',
|
Routes.operationForm,
|
||||||
extra: operation, // <-- LA MAGIA È QUI: Passa l'oggetto intero!
|
extra: (createdBy: null, operation: operation),
|
||||||
// Teniamo anche il parametro URL per coerenza di routing
|
pathParameters: {'id': operation.id!},
|
||||||
queryParameters: operation.id != null
|
|
||||||
? {'operationId': operation.id!}
|
|
||||||
: {},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -292,11 +292,9 @@ class _TicketCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'ticket-form',
|
Routes.ticketForm,
|
||||||
pathParameters: {'id': ticket.id!},
|
pathParameters: {'id': ticket.id!},
|
||||||
extra:
|
extra: (ticket: ticket, createdBy: null),
|
||||||
ticket, // <-- LA MAGIA È QUI: Passa l'oggetto intero!
|
|
||||||
// Teniamo anche il parametro URL per coerenza di routing
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user