MINOR-FIX: Solve Localization Problem.
This commit is contained in:
@@ -13,6 +13,7 @@ import 'package:get/get.dart';
|
|||||||
import 'controllers/global_setting_controller.dart';
|
import 'controllers/global_setting_controller.dart';
|
||||||
import 'controllers/theme_controller.dart';
|
import 'controllers/theme_controller.dart';
|
||||||
import 'firebase_options.dart';
|
import 'firebase_options.dart';
|
||||||
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
@@ -45,10 +46,16 @@ class MyApp extends StatelessWidget {
|
|||||||
splitScreenMode: true,
|
splitScreenMode: true,
|
||||||
child: GetMaterialApp(
|
child: GetMaterialApp(
|
||||||
translations: LocalizationService(),
|
translations: LocalizationService(),
|
||||||
locale: const Locale('uz', 'UZ'),
|
locale: const Locale('uz', 'UZ'), // current locale
|
||||||
navigatorKey: AppRouter.navigatorKey,
|
fallbackLocale: const Locale('en', 'US'),
|
||||||
fallbackLocale: const Locale('uz', 'UZ'),
|
|
||||||
supportedLocales: LocalizationService.supportedLocales,
|
supportedLocales: LocalizationService.supportedLocales,
|
||||||
|
localizationsDelegates: const [
|
||||||
|
GlobalMaterialLocalizations.delegate,
|
||||||
|
GlobalWidgetsLocalizations.delegate,
|
||||||
|
GlobalCupertinoLocalizations.delegate,
|
||||||
|
],
|
||||||
|
navigatorKey: AppRouter.navigatorKey,
|
||||||
|
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:customer/constant/const_texts.dart';
|
||||||
import 'package:customer/constant/constant.dart';
|
import 'package:customer/constant/constant.dart';
|
||||||
import 'package:customer/controllers/change_language_controller.dart';
|
import 'package:customer/controllers/change_language_controller.dart';
|
||||||
import 'package:customer/screen_ui/splash_screen/splash_screen.dart';
|
import 'package:customer/screen_ui/splash_screen/splash_screen.dart';
|
||||||
@@ -27,17 +28,6 @@ class ChangeLanguageScreen extends StatelessWidget {
|
|||||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
leading: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
// Get.back();
|
|
||||||
Navigator.pushAndRemoveUntil(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) => SplashScreen()),
|
|
||||||
(route) => false,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Icon(Icons.arrow_back),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
body:
|
body:
|
||||||
controller.isLoading.value
|
controller.isLoading.value
|
||||||
@@ -45,38 +35,41 @@ class ChangeLanguageScreen extends StatelessWidget {
|
|||||||
: Column(
|
: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Padding(
|
SizedBox(
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
height: 100.h,
|
||||||
// child: Column(
|
child: Padding(
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
// children: [
|
child: Column(
|
||||||
// Text(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
// ConstTexts.changeLanguage.tr,
|
children: [
|
||||||
// style: TextStyle(
|
Text(
|
||||||
// fontSize: 24,
|
ConstTexts.changeLanguage.tr,
|
||||||
// color:
|
style: TextStyle(
|
||||||
// isDark
|
fontSize: 24,
|
||||||
// ? AppThemeData.grey50
|
color:
|
||||||
// : AppThemeData.grey900,
|
isDark
|
||||||
// fontFamily: AppThemeData.semiBold,
|
? AppThemeData.grey50
|
||||||
// fontWeight: FontWeight.w500,
|
: AppThemeData.grey900,
|
||||||
// ),
|
fontFamily: AppThemeData.semiBold,
|
||||||
// ),
|
fontWeight: FontWeight.w500,
|
||||||
// Text(
|
),
|
||||||
// ConstTexts.selectPrefferedLanguage.tr,
|
),
|
||||||
// style: TextStyle(
|
Text(
|
||||||
// fontSize: 16,
|
ConstTexts.selectPrefferedLanguage.tr,
|
||||||
// color:
|
style: TextStyle(
|
||||||
// isDark
|
fontSize: 16,
|
||||||
// ? AppThemeData.grey50
|
color:
|
||||||
// : AppThemeData.grey900,
|
isDark
|
||||||
// fontFamily: AppThemeData.regular,
|
? AppThemeData.grey50
|
||||||
// fontWeight: FontWeight.w400,
|
: AppThemeData.grey900,
|
||||||
// ),
|
fontFamily: AppThemeData.regular,
|
||||||
// ),
|
fontWeight: FontWeight.w400,
|
||||||
// ],
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
_buildLanguageButton(
|
_buildLanguageButton(
|
||||||
isActive: Get.locale == const Locale("uz", "UZ"),
|
isActive: Get.locale == const Locale("uz", "UZ"),
|
||||||
flagCode: FlagsCode.UZ,
|
flagCode: FlagsCode.UZ,
|
||||||
|
|||||||
@@ -647,7 +647,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.3"
|
version: "0.3.3"
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
dependency: transitive
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ dependency_overrides:
|
|||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
flutter_localizations:
|
||||||
|
sdk: flutter
|
||||||
flutter_lints: ^6.0.0
|
flutter_lints: ^6.0.0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user