@@ -64,15 +64,17 @@ import 'app_localizations_zh.dart';
6464/// be consistent with the languages listed in the AppLocalizations.supportedLocales
6565/// property.
6666abstract class AppLocalizations {
67- AppLocalizations (String locale) : localeName = intl.Intl .canonicalizedLocale (locale.toString ());
67+ AppLocalizations (String locale)
68+ : localeName = intl.Intl .canonicalizedLocale (locale.toString ());
6869
6970 final String localeName;
7071
7172 static AppLocalizations ? of (BuildContext context) {
7273 return Localizations .of <AppLocalizations >(context, AppLocalizations );
7374 }
7475
75- static const LocalizationsDelegate <AppLocalizations > delegate = _AppLocalizationsDelegate ();
76+ static const LocalizationsDelegate <AppLocalizations > delegate =
77+ _AppLocalizationsDelegate ();
7678
7779 /// A list of this localizations delegate along with the default localizations
7880 /// delegates.
@@ -84,19 +86,20 @@ abstract class AppLocalizations {
8486 /// Additional delegates can be added by appending to this list in
8587 /// MaterialApp. This list does not have to be used at all if a custom list
8688 /// of delegates is preferred or required.
87- static const List <LocalizationsDelegate <dynamic >> localizationsDelegates = < LocalizationsDelegate <dynamic >> [
88- delegate,
89- GlobalMaterialLocalizations .delegate,
90- GlobalCupertinoLocalizations .delegate,
91- GlobalWidgetsLocalizations .delegate,
92- ];
89+ static const List <LocalizationsDelegate <dynamic >> localizationsDelegates =
90+ < LocalizationsDelegate <dynamic >> [
91+ delegate,
92+ GlobalMaterialLocalizations .delegate,
93+ GlobalCupertinoLocalizations .delegate,
94+ GlobalWidgetsLocalizations .delegate,
95+ ];
9396
9497 /// A list of this localizations delegate's supported locales.
9598 static const List <Locale > supportedLocales = < Locale > [
9699 Locale ('en' ),
97100 Locale ('ru' ),
98101 Locale ('th' ),
99- Locale ('zh' )
102+ Locale ('zh' ),
100103 ];
101104
102105 /// No description provided for @app_name.
@@ -232,7 +235,8 @@ abstract class AppLocalizations {
232235 String get disconnecting;
233236}
234237
235- class _AppLocalizationsDelegate extends LocalizationsDelegate <AppLocalizations > {
238+ class _AppLocalizationsDelegate
239+ extends LocalizationsDelegate <AppLocalizations > {
236240 const _AppLocalizationsDelegate ();
237241
238242 @override
@@ -241,27 +245,30 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
241245 }
242246
243247 @override
244- bool isSupported (Locale locale) => < String > ['en' , 'ru' , 'th' , 'zh' ].contains (locale.languageCode);
248+ bool isSupported (Locale locale) =>
249+ < String > ['en' , 'ru' , 'th' , 'zh' ].contains (locale.languageCode);
245250
246251 @override
247252 bool shouldReload (_AppLocalizationsDelegate old) => false ;
248253}
249254
250255AppLocalizations lookupAppLocalizations (Locale locale) {
251-
252-
253256 // Lookup logic when only language code is specified.
254257 switch (locale.languageCode) {
255- case 'en' : return AppLocalizationsEn ();
256- case 'ru' : return AppLocalizationsRu ();
257- case 'th' : return AppLocalizationsTh ();
258- case 'zh' : return AppLocalizationsZh ();
258+ case 'en' :
259+ return AppLocalizationsEn ();
260+ case 'ru' :
261+ return AppLocalizationsRu ();
262+ case 'th' :
263+ return AppLocalizationsTh ();
264+ case 'zh' :
265+ return AppLocalizationsZh ();
259266 }
260267
261268 throw FlutterError (
262269 'AppLocalizations.delegate failed to load unsupported locale "$locale ". This is likely '
263270 'an issue with the localizations generation tool. Please file an issue '
264271 'on GitHub with a reproducible sample app and the gen-l10n configuration '
265- 'that was used.'
272+ 'that was used.' ,
266273 );
267274}
0 commit comments