BASE: Switch From EasyLocalization To GetX Localization.
This commit is contained in:
@@ -4,11 +4,10 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/themes/easy_loading_config.dart';
|
||||
import 'package:customer/utils/app_router.dart';
|
||||
import 'package:customer/utils/preferences.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_phoenix/flutter_phoenix.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'controllers/global_setting_controller.dart';
|
||||
@@ -17,7 +16,7 @@ import 'firebase_options.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await EasyLocalization.ensureInitialized();
|
||||
await LocalizationService.init();
|
||||
await Firebase.initializeApp(
|
||||
name: 'default',
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
@@ -28,19 +27,7 @@ void main() async {
|
||||
Get.put(ThemeController());
|
||||
await configEasyLoading();
|
||||
|
||||
runApp(
|
||||
EasyLocalization(
|
||||
startLocale: Locale('uz', 'UZ'),
|
||||
supportedLocales: [
|
||||
Locale('en', 'US'),
|
||||
Locale('uz', 'UZ'),
|
||||
Locale('ru', 'RU'),
|
||||
],
|
||||
path: 'assets/translations',
|
||||
fallbackLocale: Locale('uz', 'UZ'),
|
||||
child: MyApp(),
|
||||
),
|
||||
);
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@@ -56,11 +43,12 @@ class MyApp extends StatelessWidget {
|
||||
designSize: Size(375, 812),
|
||||
minTextAdapt: true,
|
||||
splitScreenMode: true,
|
||||
child: MaterialApp(
|
||||
child: GetMaterialApp(
|
||||
translations: LocalizationService(),
|
||||
locale: const Locale('uz', 'UZ'),
|
||||
navigatorKey: AppRouter.navigatorKey,
|
||||
localizationsDelegates: context.localizationDelegates,
|
||||
supportedLocales: context.supportedLocales,
|
||||
locale: context.locale,
|
||||
fallbackLocale: const Locale('uz', 'UZ'),
|
||||
supportedLocales: LocalizationService.supportedLocales,
|
||||
debugShowCheckedModeBanner: false,
|
||||
builder: (context, child) {
|
||||
return SafeArea(
|
||||
|
||||
Reference in New Issue
Block a user