
Enables viewing and editing existing product details by passing the product ID to the form page. The form now loads and displays the product data based on the provided ID. Adds a delete button to each item in the product list, allowing users to remove products directly from the list view. Updates navigation from the product list and scanner pages to pass the product ID when navigating to the product form. Includes minor code style changes by applying the `sort_constructors_first` lint rule and updates dependencies (`flutter_lints`, `lints`).
137 lines
3.6 KiB
Dart
137 lines
3.6 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'go_secure_router_builder.dart';
|
|
|
|
// **************************************************************************
|
|
// GoRouterGenerator
|
|
// **************************************************************************
|
|
|
|
List<RouteBase> get $appRoutes => [$secureRoute];
|
|
|
|
RouteBase get $secureRoute => GoRouteData.$route(
|
|
path: '/SecurePage',
|
|
|
|
factory: _$SecureRoute._fromState,
|
|
routes: [
|
|
GoRouteData.$route(path: 'HomePage', factory: _$HomeRoute._fromState),
|
|
GoRouteData.$route(path: 'ScannerPage', factory: _$ScannerRoute._fromState),
|
|
GoRouteData.$route(
|
|
path: 'ProductFormPage',
|
|
|
|
factory: _$ProductFormRoute._fromState,
|
|
),
|
|
GoRouteData.$route(
|
|
path: 'ProductListPage',
|
|
|
|
factory: _$ProductListRoute._fromState,
|
|
),
|
|
],
|
|
);
|
|
|
|
mixin _$SecureRoute on GoRouteData {
|
|
static SecureRoute _fromState(GoRouterState state) => const SecureRoute();
|
|
|
|
@override
|
|
String get location => GoRouteData.$location('/SecurePage');
|
|
|
|
@override
|
|
void go(BuildContext context) => context.go(location);
|
|
|
|
@override
|
|
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
|
|
|
@override
|
|
void pushReplacement(BuildContext context) =>
|
|
context.pushReplacement(location);
|
|
|
|
@override
|
|
void replace(BuildContext context) => context.replace(location);
|
|
}
|
|
|
|
mixin _$HomeRoute on GoRouteData {
|
|
static HomeRoute _fromState(GoRouterState state) => const HomeRoute();
|
|
|
|
@override
|
|
String get location => GoRouteData.$location('/SecurePage/HomePage');
|
|
|
|
@override
|
|
void go(BuildContext context) => context.go(location);
|
|
|
|
@override
|
|
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
|
|
|
@override
|
|
void pushReplacement(BuildContext context) =>
|
|
context.pushReplacement(location);
|
|
|
|
@override
|
|
void replace(BuildContext context) => context.replace(location);
|
|
}
|
|
|
|
mixin _$ScannerRoute on GoRouteData {
|
|
static ScannerRoute _fromState(GoRouterState state) => const ScannerRoute();
|
|
|
|
@override
|
|
String get location => GoRouteData.$location('/SecurePage/ScannerPage');
|
|
|
|
@override
|
|
void go(BuildContext context) => context.go(location);
|
|
|
|
@override
|
|
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
|
|
|
@override
|
|
void pushReplacement(BuildContext context) =>
|
|
context.pushReplacement(location);
|
|
|
|
@override
|
|
void replace(BuildContext context) => context.replace(location);
|
|
}
|
|
|
|
mixin _$ProductFormRoute on GoRouteData {
|
|
static ProductFormRoute _fromState(GoRouterState state) =>
|
|
ProductFormRoute(id: int.parse(state.uri.queryParameters['id']!)!);
|
|
|
|
ProductFormRoute get _self => this as ProductFormRoute;
|
|
|
|
@override
|
|
String get location => GoRouteData.$location(
|
|
'/SecurePage/ProductFormPage',
|
|
queryParams: {'id': _self.id.toString()},
|
|
);
|
|
|
|
@override
|
|
void go(BuildContext context) => context.go(location);
|
|
|
|
@override
|
|
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
|
|
|
@override
|
|
void pushReplacement(BuildContext context) =>
|
|
context.pushReplacement(location);
|
|
|
|
@override
|
|
void replace(BuildContext context) => context.replace(location);
|
|
}
|
|
|
|
mixin _$ProductListRoute on GoRouteData {
|
|
static ProductListRoute _fromState(GoRouterState state) =>
|
|
const ProductListRoute();
|
|
|
|
@override
|
|
String get location => GoRouteData.$location('/SecurePage/ProductListPage');
|
|
|
|
@override
|
|
void go(BuildContext context) => context.go(location);
|
|
|
|
@override
|
|
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
|
|
|
@override
|
|
void pushReplacement(BuildContext context) =>
|
|
context.pushReplacement(location);
|
|
|
|
@override
|
|
void replace(BuildContext context) => context.replace(location);
|
|
}
|