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:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:krow_data_connect/krow_data_connect.dart';
|
||||
|
||||
import 'data/repositories_impl/certificates_repository_impl.dart';
|
||||
@@ -23,6 +24,9 @@ class StaffCertificatesModule extends Module {
|
||||
|
||||
@override
|
||||
void routes(RouteManager r) {
|
||||
r.child('/', child: (_) => const CertificatesPage());
|
||||
r.child(
|
||||
StaffPaths.childRoute(StaffPaths.certificates, StaffPaths.certificates),
|
||||
child: (_) => const CertificatesPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:krow_data_connect/krow_data_connect.dart';
|
||||
import 'data/repositories_impl/documents_repository_impl.dart';
|
||||
import 'domain/repositories/documents_repository.dart';
|
||||
@@ -22,6 +23,9 @@ class StaffDocumentsModule extends Module {
|
||||
|
||||
@override
|
||||
void routes(RouteManager r) {
|
||||
r.child('/', child: (_) => DocumentsPage());
|
||||
r.child(
|
||||
StaffPaths.childRoute(StaffPaths.documents, StaffPaths.documents),
|
||||
child: (_) => DocumentsPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:krow_data_connect/krow_data_connect.dart';
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
import 'data/repositories/tax_forms_repository_impl.dart';
|
||||
@@ -23,7 +24,7 @@ class StaffTaxFormsModule extends Module {
|
||||
dataConnect: ExampleConnector.instance,
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
// Use Cases
|
||||
i.addLazySingleton(GetTaxFormsUseCase.new);
|
||||
i.addLazySingleton(SubmitI9FormUseCase.new);
|
||||
@@ -37,13 +38,16 @@ class StaffTaxFormsModule extends Module {
|
||||
|
||||
@override
|
||||
void routes(RouteManager r) {
|
||||
r.child('/', child: (_) => const TaxFormsPage());
|
||||
r.child(
|
||||
'/i9',
|
||||
StaffPaths.childRoute(StaffPaths.taxForms, StaffPaths.taxForms),
|
||||
child: (_) => const TaxFormsPage(),
|
||||
);
|
||||
r.child(
|
||||
StaffPaths.childRoute(StaffPaths.taxForms, StaffPaths.formI9),
|
||||
child: (_) => FormI9Page(form: r.args.data as TaxForm?),
|
||||
);
|
||||
r.child(
|
||||
'/w4',
|
||||
StaffPaths.childRoute(StaffPaths.taxForms, StaffPaths.formW4),
|
||||
child: (_) => FormW4Page(form: r.args.data as TaxForm?),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:firebase_auth/firebase_auth.dart' as auth;
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:krow_data_connect/krow_data_connect.dart';
|
||||
import 'package:staff_bank_account/src/data/repositories/bank_account_repository_impl.dart';
|
||||
|
||||
@@ -38,6 +39,9 @@ class StaffBankAccountModule extends Module {
|
||||
|
||||
@override
|
||||
void routes(RouteManager r) {
|
||||
r.child('/', child: (_) => const BankAccountPage());
|
||||
r.child(
|
||||
StaffPaths.childRoute(StaffPaths.bankAccount, StaffPaths.bankAccount),
|
||||
child: (_) => const BankAccountPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ library staff_time_card;
|
||||
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:krow_data_connect/krow_data_connect.dart';
|
||||
|
||||
import 'data/repositories_impl/time_card_repository_impl.dart';
|
||||
@@ -39,6 +40,9 @@ class StaffTimeCardModule extends Module {
|
||||
|
||||
@override
|
||||
void routes(RouteManager r) {
|
||||
r.child('/', child: (context) => const TimeCardPage());
|
||||
r.child(
|
||||
StaffPaths.childRoute(StaffPaths.timeCard, StaffPaths.timeCard),
|
||||
child: (context) => const TimeCardPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:krow_data_connect/krow_data_connect.dart';
|
||||
|
||||
import 'data/repositories_impl/attire_repository_impl.dart';
|
||||
@@ -28,6 +29,9 @@ class StaffAttireModule extends Module {
|
||||
|
||||
@override
|
||||
void routes(RouteManager r) {
|
||||
r.child('/', child: (_) => const AttirePage());
|
||||
r.child(
|
||||
StaffPaths.childRoute(StaffPaths.attire, StaffPaths.attire),
|
||||
child: (_) => const AttirePage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user