added unit test
This commit is contained in:
@@ -40,23 +40,25 @@ class GlobalRouter {
|
||||
builder: (context, state) => CustomerListWidget(),
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: "$pathCustomer/:id",
|
||||
path: "$pathCustomer/:customerId",
|
||||
builder: (context, state) {
|
||||
var idStr = state.pathParameters['id'];
|
||||
var idStr = state.pathParameters['customerId'];
|
||||
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);
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: "$pathPicture/: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);
|
||||
},
|
||||
var pictureIdStr = state.pathParameters['pictureId'];
|
||||
var pictureId = pictureIdStr == null ? null : int.tryParse(pictureIdStr);
|
||||
return PictureWidget(customerId: customerId ?? -1, pictureId: pictureId ?? -1);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user