Use StaffPaths and core imports across staff modules
Centralize and standardize routing by introducing StaffPaths constants (shiftDetailsRoute, formI9, formW4) and using StaffPaths.childRoute in multiple staff feature modules instead of hardcoded paths. Add package:krow_core/core.dart imports where needed, clean up minor formatting/constructor spacing, make some route callbacks explicitly typed, replace shiftDetails string interpolation with the new constant, and remove a debug print from phone verification. These changes unify route definitions and add explicit tax-form routes (I-9 and W-4).
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:staff_home/src/data/repositories/home_repository_impl.dart';
|
||||
import 'package:staff_home/src/domain/repositories/home_repository.dart';
|
||||
import 'package:staff_home/src/presentation/blocs/home_cubit.dart';
|
||||
@@ -14,9 +15,7 @@ class StaffHomeModule extends Module {
|
||||
@override
|
||||
void binds(Injector i) {
|
||||
// Repository
|
||||
i.addLazySingleton<HomeRepository>(
|
||||
() => HomeRepositoryImpl(),
|
||||
);
|
||||
i.addLazySingleton<HomeRepository>(() => HomeRepositoryImpl());
|
||||
|
||||
// Presentation layer - Cubit
|
||||
i.addSingleton(HomeCubit.new);
|
||||
@@ -24,6 +23,9 @@ class StaffHomeModule extends Module {
|
||||
|
||||
@override
|
||||
void routes(RouteManager r) {
|
||||
r.child('/', child: (BuildContext context) => const WorkerHomePage());
|
||||
r.child(
|
||||
StaffPaths.childRoute(StaffPaths.home, StaffPaths.home),
|
||||
child: (BuildContext context) => const WorkerHomePage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user