fix router
This commit is contained in:
@@ -135,7 +135,7 @@ class _LatestOperationsCardContent extends StatelessWidget {
|
||||
final operation = state.operations[index];
|
||||
return InkWell(
|
||||
onTap: () => context.push(
|
||||
'/operation-form',
|
||||
'/operations/form/id=${operation.id}',
|
||||
extra: operation,
|
||||
),
|
||||
child: Padding(
|
||||
|
||||
@@ -12,7 +12,9 @@ class OperationListCubit extends Cubit<OperationListState> {
|
||||
final OperationsRepository _repository = GetIt.I<OperationsRepository>();
|
||||
final SessionCubit _sessionCubit = GetIt.I<SessionCubit>();
|
||||
|
||||
OperationListCubit() : super(const OperationListState());
|
||||
OperationListCubit() : super(const OperationListState()) {
|
||||
loadOperations(refresh: true);
|
||||
}
|
||||
|
||||
Future<void> loadOperations({bool refresh = false}) async {
|
||||
if (state.status == OperationListStatus.loading) return;
|
||||
|
||||
@@ -158,7 +158,7 @@ class _OperationListScreenState extends State<OperationListScreen> {
|
||||
),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
onTap: () => context.pushNamed(
|
||||
'operation-form',
|
||||
'operations/form/id=${operation.id}',
|
||||
extra: operation, // <-- LA MAGIA È QUI: Passa l'oggetto intero!
|
||||
// Teniamo anche il parametro URL per coerenza di routing
|
||||
queryParameters: operation.id != null
|
||||
|
||||
Reference in New Issue
Block a user