Deliver localized auth app with verification and go_router
Integrate themed login/signup, EN/RU localization, shared dummy providers, verification recovery screens and named URL routes. Store frontend guidelines, workflow skills, validation and delivery documentation. Related to #2, #3, #5 and #6.
This commit is contained in:
1 parent
27424ed886
commit
10a278c65a
44 files changed
+4128
-28
No files matched your search
@@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../providers/locale.dart';
|
||||
|
||||
import '../generated/i18n/app_localizations.dart';
|
||||
|
||||
class LocaleSelector extends StatelessWidget {
|
||||
const LocaleSelector({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final provider = context.watch<LocaleProvider>();
|
||||
return PopupMenuButton<Locale>(
|
||||
key: const ValueKey('locale-selector'),
|
||||
tooltip: AppLocalizations.of(context)!.language,
|
||||
onSelected: (locale) async {
|
||||
final saved = await provider.setLocale(locale);
|
||||
if (!saved && context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context)!.preferenceNotSaved),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
itemBuilder: (_) => AppLocalizations.supportedLocales
|
||||
.map(
|
||||
(locale) => CheckedPopupMenuItem(
|
||||
value: locale,
|
||||
checked: locale == provider.locale,
|
||||
child: Text(locale.languageCode == 'ru' ? 'Русский' : 'English'),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 14),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.language, size: 20),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
provider.locale.languageCode.toUpperCase(),
|
||||
style: Theme.of(context).textTheme.labelLarge,
|
||||
),
|
||||
const Icon(Icons.expand_more, size: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user