Vaibhav Surve 5c53a3f4be Refactor project structure and rename from 'marco' to 'on field work'
- Updated import paths across multiple files to reflect the new package name.
- Changed application name and identifiers in CMakeLists.txt, Runner.rc, and other configuration files.
- Modified web index.html and manifest.json to update the app title and name.
- Adjusted macOS and Windows project settings to align with the new application name.
- Ensured consistency in naming across all relevant files and directories.
2025-11-22 14:20:37 +05:30

44 lines
875 B
Dart

import 'package:on_field_work/helpers/widgets/my_route.dart';
class MyRoutes {
static List<MyRoute> _routes = [];
static List<MyRoute> get routes => _routes;
static registerRoute(MyRoute route) {
for (int i = 0; i < _routes.length; i++) {
if (routes[i].name == route.name) {
routes[i] = route;
return;
}
}
_routes.add(route);
}
static registerRoutes(List<MyRoute> routes) {
for (var r in routes) {
registerRoute(r);
}
}
static void create([List<MyRoute>? routes]) {
_routes = [];
if (routes != null) _routes.addAll(routes);
}
@Deprecated('Use registerRoute method instead of this')
static void add(MyRoute route) {
_routes.add(route);
}
@Deprecated('Use registerRoutes method instead of this')
static void addAll(List<MyRoute> routes) {
_routes.addAll(routes);
}
}