change routes with names

This commit is contained in:
2026-05-09 19:32:40 +02:00
parent 1081609530
commit 5f39d5b1ad
8 changed files with 83 additions and 26 deletions

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flux/core/blocs/session/session_cubit.dart';
import 'package:flux/core/routes/app_router.dart';
import 'package:flux/core/theme/theme.dart';
import 'package:flux/features/customers/blocs/customers_cubit.dart';
import 'package:flux/features/customers/models/customer_model.dart';
@@ -109,8 +110,9 @@ class _CustomersContentState extends State<CustomersContent> {
final customer = state.customers[index];
return _CustomerTile(
customer: customer,
onTap: () => context.push(
'/customer/${customer.id}',
onTap: () => context.pushNamed(
customerFormRoute,
pathParameters: {'id': customer.id!},
extra: customer,
),
);