added unit test

This commit is contained in:
verboomp
2026-01-30 14:30:53 +01:00
parent d9d64d2daa
commit 94c6becf9f
7 changed files with 145 additions and 101 deletions

View File

@@ -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);
},
),
],
),
],
),