155 lines
5.1 KiB
Dart
155 lines
5.1 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:nhancepolicy/addons.dart';
|
|
import 'package:nhancepolicy/branch/branch_selection_page.dart';
|
|
import 'package:nhancepolicy/empReview.dart';
|
|
import 'package:nhancepolicy/empDetails.dart';
|
|
import 'package:nhancepolicy/excel_verification.dart';
|
|
import 'package:nhancepolicy/hrHome.dart';
|
|
import 'package:nhancepolicy/hrVerify.dart';
|
|
import 'package:nhancepolicy/models/environment.dart';
|
|
import 'package:nhancepolicy/phone.dart';
|
|
import 'package:nhancepolicy/postFileUpload.dart';
|
|
import 'package:nhancepolicy/service/token_storage_service.dart';
|
|
import 'package:nhancepolicy/verify.dart';
|
|
import 'package:nhancepolicy/home.dart';
|
|
import 'package:nhancepolicy/hrDashboard.dart';
|
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
|
import 'package:nhancepolicy/hrLogin.dart';
|
|
import 'package:nhancepolicy/hrPolicyDetails.dart';
|
|
import 'package:nhancepolicy/oldPolicy.dart';
|
|
import 'package:firebase_core/firebase_core.dart';
|
|
|
|
import 'cdTransactionDetails.dart';
|
|
import 'email_verify.dart';
|
|
|
|
Future<void> main() async {
|
|
// html.window.onBeforeUnload.listen((event) {
|
|
// print('Local Storage cleared by window');
|
|
// html.window.localStorage.clear();
|
|
// });
|
|
// Ask confirmation (browser may or may not show it again)
|
|
// html.window.onBeforeUnload.listen((event) {
|
|
// final e = event as html.BeforeUnloadEvent;
|
|
// e.preventDefault();
|
|
// e.returnValue = '';
|
|
// });
|
|
|
|
// Always clear when user leaves (refresh/close)
|
|
// html.window.onUnload.listen((event) {
|
|
// html.window.localStorage.clear();
|
|
// });
|
|
// await dotenv.load(fileName: Environment.fileName);
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Initialize token storage
|
|
await TokenStorageService().initialize();
|
|
|
|
await Firebase.initializeApp(
|
|
options: const FirebaseOptions(
|
|
apiKey: 'AIzaSyCSvDM5fG2blDBE69Cae3S-iYRwwNBy7xo',
|
|
appId: '1:1084115316849:web:ce28f12a426f285d6c6bd0',
|
|
messagingSenderId: '1084115316849',
|
|
projectId: 'nhance-ee8d1'));
|
|
await dotenv.load(fileName: Environment.fileName);
|
|
|
|
runApp(MaterialApp(
|
|
initialRoute: 'hrLogin',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ThemeData(
|
|
primaryColor: Color(0xFF00999E), // Primary theme color
|
|
scaffoldBackgroundColor: Colors.white,
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: Color(0xFF00999E),
|
|
),
|
|
textTheme: GoogleFonts.poppinsTextTheme(),
|
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: Color(0xFF00999E), // Button background
|
|
),
|
|
),
|
|
),
|
|
routes: {
|
|
'phone': (context) => MyPhone(),
|
|
'mailVerify': (context) => MyEmailVerify(
|
|
type: '',
|
|
value: '',
|
|
|
|
),
|
|
'verify': (context) => MyVerify(
|
|
verificationId: '',
|
|
mobileNumber: '',
|
|
resendToken: null,
|
|
onResendCode: (String, int) {},
|
|
),
|
|
'home': (context) => MyApp(),
|
|
'hrLogin': (context) => MyHrLogin(),
|
|
// 'hrVerify': (context) => MyHrVerify(
|
|
// verificationId: '',
|
|
// mobileNumber: '',
|
|
// resendToken: null,
|
|
// onResendCode: (String, int) {},
|
|
// ),
|
|
'hrHome': (context) => MyHrHome(),
|
|
'excelVerify': (context) => const excelVerify(
|
|
ClientId: '',
|
|
policyTypeId: '',
|
|
ClientPoliyId: '',
|
|
clientBranchId: '',
|
|
Token: '',
|
|
TokenType: '',
|
|
cardType: '',
|
|
cardPolicyNo: '',
|
|
cardInsurer_name: '',
|
|
cardPolicy_name: '',
|
|
cardPolicy_ExpDate: '',
|
|
),
|
|
'postFileUpload': (context) => const postFileUpload(
|
|
ClientId: '',
|
|
policyTypeId: '',
|
|
ClientPoliyId: '',
|
|
clientBranchId: '',
|
|
Token: '',
|
|
TokenType: '',
|
|
cardType: '',
|
|
cardPolicyNo: '',
|
|
cardInsurer_name: '',
|
|
cardPolicy_name: '',
|
|
cardPolicy_ExpDate: '',
|
|
),
|
|
'empDetails': (context) => empDetails(),
|
|
'addOnsDetails': (context) => addOnsDetails(),
|
|
'empReviewDetails': (context) => empReviewDetails(),
|
|
'hrDashboard': (context) => hrDashboard(
|
|
selectedIndex: 0,
|
|
isHrcode: 0,
|
|
empCodeFromHrPolicy: '',
|
|
),
|
|
'cdTransactionDetails': (context) => cdTransactionDetails(
|
|
insurerName: '',
|
|
cdMasterAccountNo: '',
|
|
insurerId: '',
|
|
cd_ac_pk: '',
|
|
empClientId: '',
|
|
postToken: '',
|
|
),
|
|
'hrPolicyDetails': (context) => hrPolicyDetails(
|
|
ClientId: '',
|
|
policyTypeId: '',
|
|
ClientPoliyId: '',
|
|
clientBranchId: '',
|
|
Token: '',
|
|
TokenType: '',
|
|
cardType: '',
|
|
cardPolicyNo: '',
|
|
cardInsurer_name: '',
|
|
cardPolicy_name: '',
|
|
cardPolicy_ExpDate: '',
|
|
),
|
|
'oldPolicy': (context) => oldPolicy(),
|
|
'branchSelection': (context) => BranchSelectionPage(),
|
|
},
|
|
));
|
|
}
|