import 'package:baseproject/core/components/alice.dart'; import 'package:baseproject/core/language/app_localizations.dart'; import 'package:baseproject/core/theme/custom_theme.dart'; import 'package:baseproject/features/route/route_const.dart'; import 'package:baseproject/features/route/route_generator.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; final GlobalKey navigatorKey = GlobalKey(); class App extends StatefulWidget { const App({Key? key}) : super(key: key); @override State createState() => _AppState(); } class _AppState extends State { String _getLanguage() { return 'vi'; } @override Widget build(BuildContext context) { return MaterialApp( // navigatorObservers: [CustomNavigatorObserver()], debugShowCheckedModeBanner: false, theme: getTheme(context, true), // navigatorKey: navigatorKey, locale: Locale(_getLanguage()), supportedLocales: AppLocalizations.locales, localizationsDelegates: >[ AppLocalizations.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate ], navigatorKey: navigatorKey, localeResolutionCallback: AppLocalizations.localeResolutionCallback, initialRoute: appInitRouteName, onGenerateRoute: RouteGenerator.generatorRoute, builder: EasyLoading.init(builder: (BuildContext context, Widget? child) { EasyLoading.instance.userInteractions = false; return Container( child: kDebugMode ? Stack( children: [ child!, Positioned( bottom: 10, right: 10, child: Container( width: 30, height: 30, child: FloatingActionButton( onPressed: () { CustomAlice.showScreen(); }, backgroundColor: Colors.red, child: const Text("A"), ), ), ), ], ) : child!, ); })); } }