Add Beneficiary Animations and Localizations
This commit is contained in:
@@ -2,37 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:kmobile/config/theme_type.dart';
|
||||
import 'package:kmobile/features/auth/controllers/theme_cubit.dart';
|
||||
import 'package:kmobile/features/auth/controllers/theme_state.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(),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}*/
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
class ColorThemeDialog extends StatelessWidget {
|
||||
const ColorThemeDialog({super.key});
|
||||
@@ -40,11 +10,11 @@ class ColorThemeDialog extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
title: const Text('Select Color Theme'),
|
||||
title: Text(AppLocalizations.of(context).selectThemeColor),
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const CircleAvatar(backgroundColor: Colors.deepPurple),
|
||||
title: const Text('Violet'),
|
||||
title: Text(AppLocalizations.of(context).violet),
|
||||
onTap: () {
|
||||
context.read<ThemeCubit>().changeTheme(ThemeType.violet);
|
||||
Navigator.pop(context);
|
||||
@@ -68,7 +38,7 @@ class ColorThemeDialog extends StatelessWidget {
|
||||
// ),
|
||||
ListTile(
|
||||
leading: const CircleAvatar(backgroundColor: Colors.blue),
|
||||
title: const Text('Blue'),
|
||||
title: Text(AppLocalizations.of(context).blue),
|
||||
onTap: () {
|
||||
context.read<ThemeCubit>().changeTheme(ThemeType.blue);
|
||||
Navigator.pop(context);
|
||||
|
@@ -3,53 +3,6 @@ import '../../../l10n/app_localizations.dart';
|
||||
import 'package:kmobile/app.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 {
|
||||
const LanguageDialog({Key? key}) : super(key: key);
|
||||
|
||||
|
@@ -35,7 +35,7 @@ class PreferenceScreen extends StatelessWidget {
|
||||
//Color_Theme_Selection
|
||||
ListTile(
|
||||
leading: const Icon(Icons.color_lens),
|
||||
title: const Text('Theme Color'),
|
||||
title: Text(AppLocalizations.of(context).themeColor),
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
|
Reference in New Issue
Block a user