87 lines
3.1 KiB
Dart
87 lines
3.1 KiB
Dart
|
|
|
|
import 'package:camera/camera.dart';
|
|
import 'package:cathaypay_mobile/Home/HomePage.dart';
|
|
import 'package:cathaypay_mobile/Login/Login.dart';
|
|
import 'package:cathaypay_mobile/Login/LoginValidate.dart';
|
|
import 'package:cathaypay_mobile/Register/policy.dart';
|
|
import 'package:cathaypay_mobile/Register/register.dart';
|
|
import 'package:cathaypay_mobile/Register/register_data.dart';
|
|
import 'package:cathaypay_mobile/Register/register_picture.dart';
|
|
import 'package:cathaypay_mobile/Register/register_signature.dart';
|
|
import 'package:cathaypay_mobile/custompaint.dart';
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:intl/date_symbol_data_local.dart';
|
|
import 'package:intl/intl.dart';
|
|
|
|
import 'Register/camera_card_id.dart';
|
|
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
await EasyLocalization.ensureInitialized();
|
|
Intl.defaultLocale = "th";
|
|
initializeDateFormatting();
|
|
CameraApp = await availableCameras();
|
|
runApp(
|
|
EasyLocalization(
|
|
supportedLocales: [Locale('en'), Locale('th')],
|
|
path: 'assets/translations', // <-- change the path of the translation files
|
|
fallbackLocale: Locale('th'),
|
|
child: MyApp()),
|
|
);
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
// This widget is the root of your application.
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
// localizationsDelegates: const [
|
|
// GlobalMaterialLocalizations.delegate,
|
|
// GlobalWidgetsLocalizations.delegate,
|
|
// GlobalCupertinoLocalizations.delegate,
|
|
// ],
|
|
// supportedLocales: const [
|
|
// Locale('en', ''),
|
|
// Locale('th', ''),
|
|
// ],
|
|
localizationsDelegates: context.localizationDelegates,
|
|
supportedLocales: context.supportedLocales,
|
|
locale: context.locale,
|
|
debugShowCheckedModeBanner: false,
|
|
title: 'NEO TRAVEL',
|
|
theme: ThemeData(
|
|
primaryColor: Colors.blue,
|
|
textTheme: GoogleFonts.kanitTextTheme(
|
|
Theme.of(context).textTheme,
|
|
),
|
|
),
|
|
initialRoute: '/',
|
|
routes: {
|
|
// Login
|
|
'/': (context) => const LoginPage(),
|
|
'/LoginValidate': (context) => const LoginValidate(),
|
|
//Register
|
|
// '/RegisterPage': (context) => const RegisterPage(),
|
|
'/RegisterData': (context) => const RegisterData(),
|
|
// '/OtpPage': (context) => const OtpPage(),
|
|
'/PolicyPage': (context) => const PolicyPage(),
|
|
//'/PinCodePage': (context) => const PinCodePage(login: false,),
|
|
'/RegisterPicturePage': (context) => const RegisterPicturePage(),
|
|
'/RegisterSignaturePage': (context) => const RegisterSignaturePage(),
|
|
'/DrawScreen': (context) => DrawScreen(),
|
|
//Home
|
|
'/HomePage': (context) => const HomePage(),
|
|
});
|
|
}
|
|
}
|
|
|
|
extension E on String {
|
|
String lastChars(int n) => substring(length - n);
|
|
}
|