rework ui
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user