mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-04-03 22:11:37 +02:00
Remove useless arg
This commit is contained in:
parent
bd68566e23
commit
a99b48809e
3 changed files with 5 additions and 7 deletions
|
@ -10,10 +10,8 @@ class AppLanguage {
|
||||||
final Locale? locale;
|
final Locale? locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
String getSelectedLanguageName(BuildContext context) =>
|
String getSelectedLanguageName() => _getSelectedLanguage().nativeName;
|
||||||
_getSelectedLanguage(context).nativeName;
|
Locale? getSelectedLocale() => _getSelectedLanguage().locale;
|
||||||
Locale? getSelectedLocale(BuildContext context) =>
|
|
||||||
_getSelectedLanguage(context).locale;
|
|
||||||
|
|
||||||
final supportedLanguages = {
|
final supportedLanguages = {
|
||||||
_AppLanguageEnum.systemDefault.index: AppLanguage(
|
_AppLanguageEnum.systemDefault.index: AppLanguage(
|
||||||
|
@ -41,7 +39,7 @@ enum _AppLanguageEnum {
|
||||||
russian,
|
russian,
|
||||||
}
|
}
|
||||||
|
|
||||||
AppLanguage _getSelectedLanguage(BuildContext context) {
|
AppLanguage _getSelectedLanguage() {
|
||||||
try {
|
try {
|
||||||
final lang = Pref.inst().getLanguageOr(0);
|
final lang = Pref.inst().getLanguageOr(0);
|
||||||
return supportedLanguages[lang]!;
|
return supportedLanguages[lang]!;
|
||||||
|
|
|
@ -58,7 +58,7 @@ class _MyAppState extends State<MyApp> implements SnackBarHandler {
|
||||||
onGenerateRoute: _onGenerateRoute,
|
onGenerateRoute: _onGenerateRoute,
|
||||||
navigatorObservers: <NavigatorObserver>[MyApp.routeObserver],
|
navigatorObservers: <NavigatorObserver>[MyApp.routeObserver],
|
||||||
scaffoldMessengerKey: _scaffoldMessengerKey,
|
scaffoldMessengerKey: _scaffoldMessengerKey,
|
||||||
locale: language_util.getSelectedLocale(context),
|
locale: language_util.getSelectedLocale(),
|
||||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||||
supportedLocales: <Locale>[
|
supportedLocales: <Locale>[
|
||||||
Locale("en"),
|
Locale("en"),
|
||||||
|
|
|
@ -81,7 +81,7 @@ class _SettingsState extends State<Settings> {
|
||||||
[
|
[
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(L10n.of(context).settingsLanguageTitle),
|
title: Text(L10n.of(context).settingsLanguageTitle),
|
||||||
subtitle: Text(language_util.getSelectedLanguageName(context)),
|
subtitle: Text(language_util.getSelectedLanguageName()),
|
||||||
onTap: () => _onLanguageTap(context),
|
onTap: () => _onLanguageTap(context),
|
||||||
),
|
),
|
||||||
SwitchListTile(
|
SwitchListTile(
|
||||||
|
|
Loading…
Add table
Reference in a new issue