rework ui

This commit is contained in:
verboomp
2026-01-29 12:37:44 +01:00
parent 38979c99e5
commit e062b4c688
18 changed files with 462 additions and 246 deletions

View File

@@ -38,21 +38,27 @@ class GlobalRouter {
GoRoute(
path: pathHome,
builder: (context, state) => CustomerListWidget(),
),
GoRoute(
path: "$pathCustomer/:id",
builder: (context, state) {
var idStr = state.pathParameters['id'];
var id = idStr == null ? null : int.tryParse(idStr);
return CustomerWidget(customerId: id ?? -1);
},
),
GoRoute(
path: pathPicture,
builder: (context, state) {
PictureWidgetHolder holder = state.extra as PictureWidgetHolder;
return PictureWidget(customerDto: holder.customerDto, pictureDto: holder.pictureDto);
},
routes: [
GoRoute(
path: "$pathCustomer/:id",
builder: (context, state) {
var idStr = state.pathParameters['id'];
var id = idStr == null ? null : int.tryParse(idStr);
return CustomerWidget(customerId: id ?? -1);
},
),
GoRoute(
path: "$pathPicture/:customerId/:pictureId",
builder: (context, state) {
var customerIdStr = state.pathParameters['customerId'];
var customerId = customerIdStr == null ? null : int.tryParse(customerIdStr);
var pictureIdStr = state.pathParameters['pictureId'];
var pictureId = pictureIdStr == null ? null : int.tryParse(pictureIdStr);
return PictureWidget(customerId: customerId ?? -1, pictureId: pictureId ?? -1);
},
),
],
),
],
redirect: (context, state) {