BASE: Switch From EasyLocalization To GetX Localization.
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/controllers/change_language_controller.dart';
|
||||
import 'package:customer/screen_ui/splash_screen/splash_screen.dart';
|
||||
import 'package:customer/service/localization_service.dart';
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:flag/flag_enum.dart';
|
||||
import 'package:flag/flag_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:get/get.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
|
||||
class ChangeLanguageScreen extends StatelessWidget {
|
||||
@@ -51,7 +51,7 @@ class ChangeLanguageScreen extends StatelessWidget {
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text(
|
||||
// ConstTexts.changeLanguage.tr(),
|
||||
// ConstTexts.changeLanguage.tr,
|
||||
// style: TextStyle(
|
||||
// fontSize: 24,
|
||||
// color:
|
||||
@@ -63,7 +63,7 @@ class ChangeLanguageScreen extends StatelessWidget {
|
||||
// ),
|
||||
// ),
|
||||
// Text(
|
||||
// ConstTexts.selectPrefferedLanguage.tr(),
|
||||
// ConstTexts.selectPrefferedLanguage.tr,
|
||||
// style: TextStyle(
|
||||
// fontSize: 16,
|
||||
// color:
|
||||
@@ -78,32 +78,35 @@ class ChangeLanguageScreen extends StatelessWidget {
|
||||
// ),
|
||||
// ),
|
||||
_buildLanguageButton(
|
||||
isActive: context.locale == Locale("uz", "UZ"),
|
||||
isActive: Get.locale == const Locale("uz", "UZ"),
|
||||
flagCode: FlagsCode.UZ,
|
||||
title: "O'zbekcha",
|
||||
onTap: () async {
|
||||
await context.setLocale(Locale("uz", "UZ"));
|
||||
Get.forceAppUpdate();
|
||||
LocalizationService.changeLocale(
|
||||
const Locale('uz', 'UZ'),
|
||||
);
|
||||
},
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildLanguageButton(
|
||||
isActive: context.locale == Locale("ru", "RU"),
|
||||
isActive: Get.locale == const Locale('ru', 'RU'),
|
||||
flagCode: FlagsCode.RU,
|
||||
title: "Русский",
|
||||
onTap: () async {
|
||||
await context.setLocale(Locale("ru", "RU"));
|
||||
Get.forceAppUpdate();
|
||||
LocalizationService.changeLocale(
|
||||
const Locale("ru", "RU"),
|
||||
);
|
||||
},
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildLanguageButton(
|
||||
isActive: context.locale == Locale("en", "US"),
|
||||
isActive: Get.locale == const Locale("en", "US"),
|
||||
flagCode: FlagsCode.US,
|
||||
title: "English",
|
||||
onTap: () async {
|
||||
await context.setLocale(Locale("en", "US"));
|
||||
Get.forceAppUpdate();
|
||||
LocalizationService.changeLocale(
|
||||
const Locale("en", "US"),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user