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