Add Beneficiary Animations and Localizations
This commit is contained in:
@@ -5,9 +5,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:kmobile/security/secure_storage.dart';
|
import 'package:kmobile/security/secure_storage.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import './l10n/app_localizations.dart';
|
import './l10n/app_localizations.dart';
|
||||||
import 'config/themes.dart';
|
|
||||||
import 'config/theme_controller.dart';
|
|
||||||
import 'config/theme_mode_controller.dart';
|
|
||||||
import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
|
import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
|
||||||
import 'package:kmobile/features/auth/controllers/theme_state.dart';
|
import 'package:kmobile/features/auth/controllers/theme_state.dart';
|
||||||
import 'config/routes.dart';
|
import 'config/routes.dart';
|
||||||
|
@@ -1,28 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
|
||||||
import 'package:kmobile/config/theme_type.dart';
|
|
||||||
|
|
||||||
class ThemeController with ChangeNotifier {
|
|
||||||
ThemeType _currentTheme = ThemeType.violet;
|
|
||||||
|
|
||||||
ThemeType get currentTheme => _currentTheme;
|
|
||||||
|
|
||||||
Future<void> loadTheme() async {
|
|
||||||
final prefs = await SharedPreferences.getInstance();
|
|
||||||
final savedTheme = prefs.getString('color_theme');
|
|
||||||
if (savedTheme != null) {
|
|
||||||
_currentTheme = ThemeType.values.firstWhere(
|
|
||||||
(e) => e.name == savedTheme,
|
|
||||||
orElse: () => ThemeType.violet,
|
|
||||||
);
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> setTheme(ThemeType theme) async {
|
|
||||||
_currentTheme = theme;
|
|
||||||
notifyListeners();
|
|
||||||
final prefs = await SharedPreferences.getInstance();
|
|
||||||
await prefs.setString('color_theme', theme.name);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,40 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
|
||||||
|
|
||||||
class ThemeModeController with ChangeNotifier {
|
|
||||||
ThemeMode _currentThemeMode = ThemeMode.system;
|
|
||||||
|
|
||||||
ThemeMode get currentThemeMode => _currentThemeMode;
|
|
||||||
|
|
||||||
Future<void> loadThemeMode() async {
|
|
||||||
final prefs = await SharedPreferences.getInstance();
|
|
||||||
final savedMode = prefs.getString('theme_mode');
|
|
||||||
if (savedMode != null) {
|
|
||||||
switch (savedMode) {
|
|
||||||
case 'light':
|
|
||||||
_currentThemeMode = ThemeMode.light;
|
|
||||||
break;
|
|
||||||
case 'dark':
|
|
||||||
_currentThemeMode = ThemeMode.dark;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_currentThemeMode = ThemeMode.system;
|
|
||||||
}
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> toggleThemeMode() async {
|
|
||||||
if (_currentThemeMode == ThemeMode.light) {
|
|
||||||
_currentThemeMode = ThemeMode.dark;
|
|
||||||
} else {
|
|
||||||
_currentThemeMode = ThemeMode.light;
|
|
||||||
}
|
|
||||||
notifyListeners();
|
|
||||||
final prefs = await SharedPreferences.getInstance();
|
|
||||||
await prefs.setString(
|
|
||||||
'theme_mode',
|
|
||||||
_currentThemeMode == ThemeMode.light ? 'light' : 'dark',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,66 +1,3 @@
|
|||||||
/*class AppThemes {
|
|
||||||
static ThemeData getLightTheme(ThemeType type) {
|
|
||||||
switch (type) {
|
|
||||||
case ThemeType.green:
|
|
||||||
return ThemeData(
|
|
||||||
brightness: Brightness.light,
|
|
||||||
primarySwatch: Colors.green,
|
|
||||||
scaffoldBackgroundColor: Colors.white,
|
|
||||||
);
|
|
||||||
case ThemeType.orange:
|
|
||||||
return ThemeData(
|
|
||||||
brightness: Brightness.light,
|
|
||||||
primarySwatch: Colors.orange,
|
|
||||||
scaffoldBackgroundColor: Colors.white,
|
|
||||||
);
|
|
||||||
case ThemeType.blue:
|
|
||||||
return ThemeData(
|
|
||||||
brightness: Brightness.light,
|
|
||||||
primarySwatch: Colors.blue,
|
|
||||||
scaffoldBackgroundColor: Colors.white,
|
|
||||||
);
|
|
||||||
case ThemeType.violet:
|
|
||||||
default:
|
|
||||||
return ThemeData(
|
|
||||||
brightness: Brightness.light,
|
|
||||||
primarySwatch: Colors.deepPurple,
|
|
||||||
scaffoldBackgroundColor: Colors.white,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static ThemeData getDarkTheme(ThemeType type) {
|
|
||||||
switch (type) {
|
|
||||||
case ThemeType.green:
|
|
||||||
return ThemeData(
|
|
||||||
brightness: Brightness.dark,
|
|
||||||
primarySwatch: Colors.green,
|
|
||||||
scaffoldBackgroundColor: Colors.black,
|
|
||||||
);
|
|
||||||
case ThemeType.orange:
|
|
||||||
return ThemeData(
|
|
||||||
brightness: Brightness.dark,
|
|
||||||
primarySwatch: Colors.orange,
|
|
||||||
scaffoldBackgroundColor: Colors.black,
|
|
||||||
);
|
|
||||||
case ThemeType.blue:
|
|
||||||
return ThemeData(
|
|
||||||
brightness: Brightness.dark,
|
|
||||||
primarySwatch: Colors.blue,
|
|
||||||
scaffoldBackgroundColor: Colors.black,
|
|
||||||
);
|
|
||||||
case ThemeType.violet:
|
|
||||||
default:
|
|
||||||
return ThemeData(
|
|
||||||
brightness: Brightness.dark,
|
|
||||||
primarySwatch: Colors.deepPurple,
|
|
||||||
scaffoldBackgroundColor: Colors.black,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'theme_type.dart';
|
import 'theme_type.dart';
|
||||||
|
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'theme_state.dart';
|
import 'theme_state.dart';
|
||||||
import 'package:kmobile/config/theme_type.dart';
|
import 'package:kmobile/config/theme_type.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
@@ -47,14 +45,5 @@ class ThemeCubit extends Cubit<ThemeState> {
|
|||||||
print('default macthed');
|
print('default macthed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<void> toggleDarkMode(bool isDark) async {
|
|
||||||
// final prefs = await SharedPreferences.getInstance();
|
|
||||||
// await prefs.setBool('is_dark_mode', isDark);
|
|
||||||
|
|
||||||
// emit(state.copyWith(
|
|
||||||
// themeMode: isDark ? ThemeMode.dark : ThemeMode.light,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,32 +1,7 @@
|
|||||||
import 'package:equatable/equatable.dart';
|
import 'package:equatable/equatable.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:kmobile/config/theme_type.dart';
|
import 'package:kmobile/config/theme_type.dart';
|
||||||
import 'package:kmobile/config/themes.dart';
|
import 'package:kmobile/config/themes.dart';
|
||||||
|
|
||||||
// class ThemeState {
|
|
||||||
// final ThemeData lightTheme;
|
|
||||||
// final ThemeMode themeMode;
|
|
||||||
// final ThemeType themeType;
|
|
||||||
|
|
||||||
// ThemeState({
|
|
||||||
// required this.lightTheme,
|
|
||||||
// required this.themeMode,
|
|
||||||
// required this.themeType,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// ThemeState copyWith({
|
|
||||||
// ThemeData? lightTheme,
|
|
||||||
// ThemeMode? themeMode,
|
|
||||||
// ThemeType? themeType,
|
|
||||||
// }) {
|
|
||||||
// return ThemeState(
|
|
||||||
// lightTheme: lightTheme ?? this.lightTheme,
|
|
||||||
// themeMode: themeMode ?? this.themeMode,
|
|
||||||
// themeType: themeType ?? this.themeType,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// bool get isDarkMode => themeMode == ThemeMode.dark;
|
|
||||||
// }
|
|
||||||
|
|
||||||
abstract class ThemeState extends Equatable {
|
abstract class ThemeState extends Equatable {
|
||||||
getThemeData();
|
getThemeData();
|
||||||
|
@@ -64,12 +64,12 @@ bool _isLoading = false; //for validateIFSC()
|
|||||||
|
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(content: Text('Invalid IFSC code')),
|
SnackBar(content: Text(AppLocalizations.of(context).invalidIfsc)),
|
||||||
);
|
);
|
||||||
bankNameController.clear();
|
bankNameController.clear();
|
||||||
branchNameController.clear();
|
branchNameController.clear();
|
||||||
} else {
|
} else {
|
||||||
print("Valid IFSC: ${result.bankName}, ${result.branchName}");
|
print("${AppLocalizations.of(context).validIfsc}: ${result.bankName}, ${result.branchName}");
|
||||||
bankNameController.text = result.bankName;
|
bankNameController.text = result.bankName;
|
||||||
branchNameController.text = result.branchName;
|
branchNameController.text = result.branchName;
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ void validateAndAddBeneficiary() async {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
Navigator.pop(context); // Close the spinner
|
Navigator.pop(context); // Close the spinner
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(content: Text("Something went wrong during validation.")),
|
SnackBar(content: Text(AppLocalizations.of(context).somethingWentWrong)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,10 +178,10 @@ void validateAndAddBeneficiary() async {
|
|||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -213,10 +213,10 @@ void validateAndAddBeneficiary() async {
|
|||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -249,10 +249,10 @@ void validateAndAddBeneficiary() async {
|
|||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Theme.of(context).dialogBackgroundColor,
|
fillColor: Theme.of(context).dialogBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -271,14 +271,14 @@ void validateAndAddBeneficiary() async {
|
|||||||
controller: ifscController,
|
controller: ifscController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context).ifscCode,
|
labelText: AppLocalizations.of(context).ifscCode,
|
||||||
border: OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -320,14 +320,14 @@ void validateAndAddBeneficiary() async {
|
|||||||
enabled: false, // changed from readOnly to disabled
|
enabled: false, // changed from readOnly to disabled
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context).bankName,
|
labelText: AppLocalizations.of(context).bankName,
|
||||||
border: OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Theme.of(context).dialogBackgroundColor, // disabled color
|
fillColor: Theme.of(context).dialogBackgroundColor, // disabled color
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.black),
|
borderSide: BorderSide(color: Colors.black),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: const OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
width: 2,
|
width: 2,
|
||||||
@@ -343,7 +343,7 @@ void validateAndAddBeneficiary() async {
|
|||||||
enabled: false, // changed from readOnly to disabled
|
enabled: false, // changed from readOnly to disabled
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: AppLocalizations.of(context).branchName,
|
labelText: AppLocalizations.of(context).branchName,
|
||||||
border: OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
isDense: true,
|
isDense: true,
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Theme.of(context).dialogBackgroundColor,
|
fillColor: Theme.of(context).dialogBackgroundColor,
|
||||||
|
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:lottie/lottie.dart';
|
import 'package:lottie/lottie.dart';
|
||||||
import 'package:confetti/confetti.dart';
|
import 'package:confetti/confetti.dart';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
class BeneficiaryResultPage extends StatefulWidget {
|
class BeneficiaryResultPage extends StatefulWidget {
|
||||||
final bool isSuccess;
|
final bool isSuccess;
|
||||||
@@ -53,8 +54,8 @@ class _BeneficiaryResultPageState extends State<BeneficiaryResultPage> {
|
|||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
widget.isSuccess
|
widget.isSuccess
|
||||||
? 'Beneficiary Added Successfully!'
|
? AppLocalizations.of(context).beneficiaryAddedSuccess
|
||||||
: 'Beneficiary Addition Failed!',
|
: AppLocalizations.of(context).beneficiaryAdditionFailed,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
@@ -482,7 +482,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
const FundTransferBeneficiaryScreen()));
|
const FundTransferBeneficiaryScreen()));
|
||||||
}, disable: false),
|
}, disable: true),
|
||||||
_buildQuickLink(Symbols.server_person,
|
_buildQuickLink(Symbols.server_person,
|
||||||
AppLocalizations.of(context).accountInfo, () {
|
AppLocalizations.of(context).accountInfo, () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:kmobile/features/fund_transfer/screens/transaction_pin_screen.dart';
|
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
import '../../../l10n/app_localizations.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
|
@@ -7,7 +7,6 @@ import 'package:kmobile/data/models/transfer.dart';
|
|||||||
import 'package:kmobile/di/injection.dart';
|
import 'package:kmobile/di/injection.dart';
|
||||||
import 'package:kmobile/features/fund_transfer/screens/payment_animation.dart';
|
import 'package:kmobile/features/fund_transfer/screens/payment_animation.dart';
|
||||||
import 'package:kmobile/features/fund_transfer/screens/tpin_prompt_screen.dart';
|
import 'package:kmobile/features/fund_transfer/screens/tpin_prompt_screen.dart';
|
||||||
import 'package:kmobile/features/fund_transfer/screens/transaction_success_screen.dart';
|
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
|
||||||
class TransactionPinScreen extends StatefulWidget {
|
class TransactionPinScreen extends StatefulWidget {
|
||||||
|
@@ -2,37 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:kmobile/config/theme_type.dart';
|
import 'package:kmobile/config/theme_type.dart';
|
||||||
import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
|
import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
|
||||||
import 'package:kmobile/features/auth/controllers/theme_state.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
|
|
||||||
/*void showColorThemeDialog(BuildContext context) {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => AlertDialog(
|
|
||||||
title: const Text('Select Theme Color'),
|
|
||||||
content: BlocBuilder<ThemeCubit, ThemeState>(
|
|
||||||
builder: (context, state) {
|
|
||||||
return Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: ThemeType.values.map((type) {
|
|
||||||
return RadioListTile<ThemeType>(
|
|
||||||
value: type,
|
|
||||||
groupValue: state.themeType,
|
|
||||||
title: Text(type.name.toUpperCase()),
|
|
||||||
onChanged: (val) {
|
|
||||||
if (val != null) {
|
|
||||||
context.read<ThemeCubit>().changeTheme(val);
|
|
||||||
Navigator.pop(context);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
class ColorThemeDialog extends StatelessWidget {
|
class ColorThemeDialog extends StatelessWidget {
|
||||||
const ColorThemeDialog({super.key});
|
const ColorThemeDialog({super.key});
|
||||||
@@ -40,11 +10,11 @@ class ColorThemeDialog extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SimpleDialog(
|
return SimpleDialog(
|
||||||
title: const Text('Select Color Theme'),
|
title: Text(AppLocalizations.of(context).selectThemeColor),
|
||||||
children: [
|
children: [
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const CircleAvatar(backgroundColor: Colors.deepPurple),
|
leading: const CircleAvatar(backgroundColor: Colors.deepPurple),
|
||||||
title: const Text('Violet'),
|
title: Text(AppLocalizations.of(context).violet),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<ThemeCubit>().changeTheme(ThemeType.violet);
|
context.read<ThemeCubit>().changeTheme(ThemeType.violet);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
@@ -68,7 +38,7 @@ class ColorThemeDialog extends StatelessWidget {
|
|||||||
// ),
|
// ),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const CircleAvatar(backgroundColor: Colors.blue),
|
leading: const CircleAvatar(backgroundColor: Colors.blue),
|
||||||
title: const Text('Blue'),
|
title: Text(AppLocalizations.of(context).blue),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<ThemeCubit>().changeTheme(ThemeType.blue);
|
context.read<ThemeCubit>().changeTheme(ThemeType.blue);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
@@ -3,53 +3,6 @@ import '../../../l10n/app_localizations.dart';
|
|||||||
import 'package:kmobile/app.dart';
|
import 'package:kmobile/app.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
/*class LanguageDialog extends StatelessWidget {
|
|
||||||
const LanguageDialog({super.key});
|
|
||||||
|
|
||||||
String getLocaleName(AppLocalizations localizations, String code) {
|
|
||||||
final localeCodeMap = {
|
|
||||||
'en': localizations.english,
|
|
||||||
'hi': localizations.hindi,
|
|
||||||
};
|
|
||||||
return localeCodeMap[code] ?? 'Unknown';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Builder(
|
|
||||||
builder: (context) {
|
|
||||||
final localizations = AppLocalizations.of(context);
|
|
||||||
|
|
||||||
final supportedLocales = [const Locale('en'), const Locale('hi')];
|
|
||||||
|
|
||||||
return AlertDialog(
|
|
||||||
title: Text(localizations.language),
|
|
||||||
content: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: supportedLocales.map((locale) {
|
|
||||||
return ListTile(
|
|
||||||
leading: const Icon(Icons.language),
|
|
||||||
title: Text(getLocaleName(localizations, locale.languageCode)),
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
KMobile.setLocale(context, locale);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.pop(context),
|
|
||||||
child: Text(localizations.cancel),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
class LanguageDialog extends StatelessWidget {
|
class LanguageDialog extends StatelessWidget {
|
||||||
const LanguageDialog({Key? key}) : super(key: key);
|
const LanguageDialog({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@@ -35,7 +35,7 @@ class PreferenceScreen extends StatelessWidget {
|
|||||||
//Color_Theme_Selection
|
//Color_Theme_Selection
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.color_lens),
|
leading: const Icon(Icons.color_lens),
|
||||||
title: const Text('Theme Color'),
|
title: Text(AppLocalizations.of(context).themeColor),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
@@ -219,6 +219,14 @@
|
|||||||
"setMPIN": "Set your mPIN",
|
"setMPIN": "Set your mPIN",
|
||||||
"confirmMPIN": "Confirm your mPIN",
|
"confirmMPIN": "Confirm your mPIN",
|
||||||
"kconnect": "Kconnect",
|
"kconnect": "Kconnect",
|
||||||
"kccBankFull": "Kangra Central Co-operative Bank"
|
"kccBankFull": "Kangra Central Co-operative Bank",
|
||||||
|
"themeColor": "Theme Color",
|
||||||
|
"selectThemeColor": "Select Theme Color",
|
||||||
|
"violet": "Violet",
|
||||||
|
"blue": "Blue",
|
||||||
|
"invalidIfsc": "Invalid IFSC code",
|
||||||
|
"validIfsc": "Valid IFSC",
|
||||||
|
"beneficiaryAddedSuccess": "Beneficiary Added Successfully",
|
||||||
|
"beneficiaryAdditionFailed": "Beneficiary Addition Failed"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -219,5 +219,13 @@
|
|||||||
"setMPIN": "अपना mPIN सेट करें",
|
"setMPIN": "अपना mPIN सेट करें",
|
||||||
"confirmMPIN": "अपना mPIN की पुष्टि करें",
|
"confirmMPIN": "अपना mPIN की पुष्टि करें",
|
||||||
"kconnect": "के-कनेक्ट",
|
"kconnect": "के-कनेक्ट",
|
||||||
"kccBankFull": "कांगड़ा सेंट्रल को-ऑपरेटिव बैंक"
|
"kccBankFull": "कांगड़ा सेंट्रल को-ऑपरेटिव बैंक",
|
||||||
|
"themeColor": "थीम रंग",
|
||||||
|
"selectThemeColor": "थीम रंग चुनें",
|
||||||
|
"violet": "बैंगनी",
|
||||||
|
"blue": "नीला",
|
||||||
|
"invalidIfsc": "अमान्य IFSC कोड",
|
||||||
|
"validIfsc": "मान्य IFSC",
|
||||||
|
"beneficiaryAddedSuccess": "लाभार्थी सफलतापूर्वक जोड़ा गया",
|
||||||
|
"beneficiaryAdditionFailed": "लाभार्थी जोड़ने में विफल"
|
||||||
}
|
}
|
||||||
|
@@ -1342,6 +1342,54 @@ abstract class AppLocalizations {
|
|||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'Kangra Central Co-operative Bank'**
|
/// **'Kangra Central Co-operative Bank'**
|
||||||
String get kccBankFull;
|
String get kccBankFull;
|
||||||
|
|
||||||
|
/// No description provided for @themeColor.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Theme Color'**
|
||||||
|
String get themeColor;
|
||||||
|
|
||||||
|
/// No description provided for @selectThemeColor.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Select Theme Color'**
|
||||||
|
String get selectThemeColor;
|
||||||
|
|
||||||
|
/// No description provided for @violet.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Violet'**
|
||||||
|
String get violet;
|
||||||
|
|
||||||
|
/// No description provided for @blue.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Blue'**
|
||||||
|
String get blue;
|
||||||
|
|
||||||
|
/// No description provided for @invalidIfsc.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Invalid IFSC code'**
|
||||||
|
String get invalidIfsc;
|
||||||
|
|
||||||
|
/// No description provided for @validIfsc.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Valid IFSC'**
|
||||||
|
String get validIfsc;
|
||||||
|
|
||||||
|
/// No description provided for @beneficiaryAddedSuccess.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Beneficiary Added Successfully'**
|
||||||
|
String get beneficiaryAddedSuccess;
|
||||||
|
|
||||||
|
/// No description provided for @beneficiaryAdditionFailed.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Beneficiary Addition Failed'**
|
||||||
|
String get beneficiaryAdditionFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
|
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
|
||||||
|
@@ -631,4 +631,28 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String get kccBankFull => 'Kangra Central Co-operative Bank';
|
String get kccBankFull => 'Kangra Central Co-operative Bank';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get themeColor => 'Theme Color';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get selectThemeColor => 'Select Theme Color';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get violet => 'Violet';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get blue => 'Blue';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get invalidIfsc => 'Invalid IFSC code';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get validIfsc => 'Valid IFSC';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get beneficiaryAddedSuccess => 'Beneficiary Added Successfully';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get beneficiaryAdditionFailed => 'Beneficiary Addition Failed';
|
||||||
}
|
}
|
||||||
|
@@ -631,4 +631,28 @@ class AppLocalizationsHi extends AppLocalizations {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String get kccBankFull => 'कांगड़ा सेंट्रल को-ऑपरेटिव बैंक';
|
String get kccBankFull => 'कांगड़ा सेंट्रल को-ऑपरेटिव बैंक';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get themeColor => 'थीम रंग';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get selectThemeColor => 'थीम रंग चुनें';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get violet => 'बैंगनी';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get blue => 'नीला';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get invalidIfsc => 'अमान्य IFSC कोड';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get validIfsc => 'मान्य IFSC';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get beneficiaryAddedSuccess => 'लाभार्थी सफलतापूर्वक जोड़ा गया';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get beneficiaryAdditionFailed => 'लाभार्थी जोड़ने में विफल';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user