From e4e104837bd8faf0998c9f3dff792a81032642f7 Mon Sep 17 00:00:00 2001 From: Nilanjan Chakrabarti Date: Wed, 10 Sep 2025 11:43:15 +0530 Subject: [PATCH] Localization Changes #6 --- lib/di/injection.dart | 4 ++-- .../preferences/theme_mode_dialog.dart | 19 ++++++++++++++++--- lib/l10n/app_en.arb | 6 +++++- lib/l10n/app_hi.arb | 6 +++++- lib/main.dart | 14 +++++++------- 5 files changed, 35 insertions(+), 14 deletions(-) diff --git a/lib/di/injection.dart b/lib/di/injection.dart index b651f4a..f6045b6 100644 --- a/lib/di/injection.dart +++ b/lib/di/injection.dart @@ -65,8 +65,8 @@ Dio _createDioClient() { final dio = Dio( BaseOptions( baseUrl: - //'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', - 'http://localhost:8081', + 'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080', + //'http://localhost:8081', // 'http://localhost:8082', connectTimeout: const Duration(seconds: 5), receiveTimeout: const Duration(seconds: 10), diff --git a/lib/features/profile/preferences/theme_mode_dialog.dart b/lib/features/profile/preferences/theme_mode_dialog.dart index 5f3dca3..6cffc3f 100644 --- a/lib/features/profile/preferences/theme_mode_dialog.dart +++ b/lib/features/profile/preferences/theme_mode_dialog.dart @@ -1,21 +1,34 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:kmobile/features/auth/controllers/theme_mode_cubit.dart'; +import '../../../l10n/app_localizations.dart'; + +String _getThemeModeText(ThemeMode mode, AppLocalizations l10n) { + switch (mode) { + case ThemeMode.system: + return l10n.themeModeSystem; + case ThemeMode.light: + return l10n.themeModeLight; + case ThemeMode.dark: + return l10n.themeModeDark; + } +} Future showThemeModeDialog(BuildContext context) async { final cubit = context.read(); final currentMode = context.read().state.mode; + final l10n = AppLocalizations.of(context); await showDialog( context: context, builder: (context) { return AlertDialog( - title: const Text("Select Theme Mode"), + title: Text(l10n.selectThemeMode), content: Column( mainAxisSize: MainAxisSize.min, children: ThemeMode.values.map((mode) { return RadioListTile( - title: Text(mode.toString().split('.').last.toUpperCase()), + title: Text(_getThemeModeText(mode, l10n)), value: mode, groupValue: currentMode, onChanged: (value) { @@ -30,4 +43,4 @@ Future showThemeModeDialog(BuildContext context) async { ); }, ); -} +} \ No newline at end of file diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 0a203a1..4ff710f 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -308,5 +308,9 @@ "otpVerification": "OTP Verification", "otpSent": "An OTP has been sent to your registered mobile number.", "enterOTP": "Enter OTP", -"validateOTP": "Validate OTP" +"validateOTP": "Validate OTP", + "selectThemeMode": "Select Theme Mode", + "themeModeSystem": "System", + "themeModeLight": "Light", + "themeModeDark": "Dark" } diff --git a/lib/l10n/app_hi.arb b/lib/l10n/app_hi.arb index 0242675..5e6e87f 100644 --- a/lib/l10n/app_hi.arb +++ b/lib/l10n/app_hi.arb @@ -309,5 +309,9 @@ "otpVerification": "ओटीपी सत्यापन", "otpSent": "आपके पंजीकृत मोबाइल नंबर पर एक ओटीपी भेजा गया है।", "enterOTP": "ओटीपी दर्ज करें", -"validateOTP": "ओटीपी सत्यापित करें" +"validateOTP": "ओटीपी सत्यापित करें", + "selectThemeMode": "थीम मोड चुनें", + "themeModeSystem": "सिस्टम", + "themeModeLight": "लाईट", + "themeModeDark": "डार्क" } diff --git a/lib/main.dart b/lib/main.dart index ad4c61c..a62f353 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -17,13 +17,13 @@ void main() async { ]); // Check for device compromise - final compromisedMessage = await SecurityService.deviceCompromisedMessage; - if (compromisedMessage != null) { - runApp(MaterialApp( - home: SecurityErrorScreen(message: compromisedMessage), - )); - return; - } + // final compromisedMessage = await SecurityService.deviceCompromisedMessage; + // if (compromisedMessage != null) { + // runApp(MaterialApp( + // home: SecurityErrorScreen(message: compromisedMessage), + // )); + // return; + // } // Initialize dependencies await setupDependencies();