@@ -62,15 +62,17 @@ import 'app_localizations_en.dart';
6262/// be consistent with the languages listed in the AppLocalizations.supportedLocales
6363/// property.
6464abstract class AppLocalizations {
65- AppLocalizations (String locale) : localeName = intl.Intl .canonicalizedLocale (locale.toString ());
65+ AppLocalizations (String locale)
66+ : localeName = intl.Intl .canonicalizedLocale (locale.toString ());
6667
6768 final String localeName;
6869
6970 static AppLocalizations of (BuildContext context) {
7071 return Localizations .of <AppLocalizations >(context, AppLocalizations )! ;
7172 }
7273
73- static const LocalizationsDelegate <AppLocalizations > delegate = _AppLocalizationsDelegate ();
74+ static const LocalizationsDelegate <AppLocalizations > delegate =
75+ _AppLocalizationsDelegate ();
7476
7577 /// A list of this localizations delegate along with the default localizations
7678 /// delegates.
@@ -82,17 +84,18 @@ abstract class AppLocalizations {
8284 /// Additional delegates can be added by appending to this list in
8385 /// MaterialApp. This list does not have to be used at all if a custom list
8486 /// of delegates is preferred or required.
85- static const List <LocalizationsDelegate <dynamic >> localizationsDelegates = < LocalizationsDelegate <dynamic >> [
86- delegate,
87- GlobalMaterialLocalizations .delegate,
88- GlobalCupertinoLocalizations .delegate,
89- GlobalWidgetsLocalizations .delegate,
90- ];
87+ static const List <LocalizationsDelegate <dynamic >> localizationsDelegates =
88+ < LocalizationsDelegate <dynamic >> [
89+ delegate,
90+ GlobalMaterialLocalizations .delegate,
91+ GlobalCupertinoLocalizations .delegate,
92+ GlobalWidgetsLocalizations .delegate,
93+ ];
9194
9295 /// A list of this localizations delegate's supported locales.
9396 static const List <Locale > supportedLocales = < Locale > [
9497 Locale ('ar' ),
95- Locale ('en' )
98+ Locale ('en' ),
9699 ];
97100
98101 /// Headline for the main authentication page
@@ -2838,7 +2841,8 @@ abstract class AppLocalizations {
28382841 String get saveAdMessage;
28392842}
28402843
2841- class _AppLocalizationsDelegate extends LocalizationsDelegate <AppLocalizations > {
2844+ class _AppLocalizationsDelegate
2845+ extends LocalizationsDelegate <AppLocalizations > {
28422846 const _AppLocalizationsDelegate ();
28432847
28442848 @override
@@ -2847,25 +2851,26 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
28472851 }
28482852
28492853 @override
2850- bool isSupported (Locale locale) => < String > ['ar' , 'en' ].contains (locale.languageCode);
2854+ bool isSupported (Locale locale) =>
2855+ < String > ['ar' , 'en' ].contains (locale.languageCode);
28512856
28522857 @override
28532858 bool shouldReload (_AppLocalizationsDelegate old) => false ;
28542859}
28552860
28562861AppLocalizations lookupAppLocalizations (Locale locale) {
2857-
2858-
28592862 // Lookup logic when only language code is specified.
28602863 switch (locale.languageCode) {
2861- case 'ar' : return AppLocalizationsAr ();
2862- case 'en' : return AppLocalizationsEn ();
2864+ case 'ar' :
2865+ return AppLocalizationsAr ();
2866+ case 'en' :
2867+ return AppLocalizationsEn ();
28632868 }
28642869
28652870 throw FlutterError (
28662871 'AppLocalizations.delegate failed to load unsupported locale "$locale ". This is likely '
28672872 'an issue with the localizations generation tool. Please file an issue '
28682873 'on GitHub with a reproducible sample app and the gen-l10n configuration '
2869- 'that was used.'
2874+ 'that was used.' ,
28702875 );
28712876}
0 commit comments