Skip to content

Commit

Permalink
Prettier widgets localizations overrides delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
alesimula committed May 26, 2023
1 parent d7873c7 commit 8defce2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/utils/locale_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ extension LocaleUtils on Locale {
}

// Only used to add extra missing RTL languages
class _WidgetsLocalizationsDelegateOverrides extends widgets.LocalizationsDelegate<widgets.WidgetsLocalizations> {
const _WidgetsLocalizationsDelegateOverrides();
class _WidgetsLocalizationsOverridesDelegate extends widgets.LocalizationsDelegate<widgets.WidgetsLocalizations> {
const _WidgetsLocalizationsOverridesDelegate();
@override bool isSupported(Locale locale) => true;
@override Future<widgets.WidgetsLocalizations> load(Locale locale) => WidgetLocalizationOverrides.load(locale);
@override bool shouldReload(_WidgetsLocalizationsDelegateOverrides old) => false;
@override bool shouldReload(_WidgetsLocalizationsOverridesDelegate old) => false;
@override String toString() => 'WidgetLocalizationOverrides.delegate(all locales)';
}

Expand All @@ -85,7 +85,7 @@ class WidgetLocalizationOverrides extends locale.GlobalWidgetsLocalizations {
}

late TextDirection _textDirection;
static const widgets.LocalizationsDelegate<widgets.WidgetsLocalizations> delegate = _WidgetsLocalizationsDelegateOverrides();
static const widgets.LocalizationsDelegate<widgets.WidgetsLocalizations> delegate = _WidgetsLocalizationsOverridesDelegate();
@override TextDirection get textDirection => _textDirection;
static Future<widgets.WidgetsLocalizations> load(Locale locale) {
return SynchronousFuture<widgets.WidgetsLocalizations>(WidgetLocalizationOverrides(locale));
Expand Down

0 comments on commit 8defce2

Please sign in to comment.