123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- import 'dart:async';
- import 'package:flutter/foundation.dart';
- import 'package:flutter/material.dart';
- // ignore_for_file: non_constant_identifier_names
- // ignore_for_file: camel_case_types
- // ignore_for_file: prefer_single_quotes
- //This file is automatically generated. DO NOT EDIT, all your changes would be lost.
- class S implements WidgetsLocalizations {
- const S();
- static const GeneratedLocalizationsDelegate delegate =
- GeneratedLocalizationsDelegate();
- static S of(BuildContext context) => Localizations.of<S>(context, S);
- @override
- TextDirection get textDirection => TextDirection.ltr;
- String get cleans => "Cleans";
- String get level => "Level";
- String get next => "Next";
- String get pause_resume => "PAUSE/RESUME";
- String get points => "Points";
- String get reset => "RESET";
- String get reward => "Reward";
- String get sounds => "SOUNDS";
- }
- class $en extends S {
- const $en();
- }
- class $zh_CN extends S {
- const $zh_CN();
- @override
- TextDirection get textDirection => TextDirection.ltr;
- @override
- String get next => "下一个";
- @override
- String get reward => "赞赏";
- @override
- String get sounds => "声音";
- @override
- String get pause_resume => "暂停/恢复";
- @override
- String get level => "级别";
- @override
- String get reset => "重置";
- @override
- String get cleans => "消除";
- @override
- String get points => "分数";
- }
- class GeneratedLocalizationsDelegate extends LocalizationsDelegate<S> {
- const GeneratedLocalizationsDelegate();
- List<Locale> get supportedLocales {
- return const <Locale>[
- Locale("en", ""),
- Locale("zh", "CN"),
- ];
- }
- LocaleListResolutionCallback listResolution({Locale fallback}) {
- return (List<Locale> locales, Iterable<Locale> supported) {
- if (locales == null || locales.isEmpty) {
- return fallback ?? supported.first;
- } else {
- return _resolve(locales.first, fallback, supported);
- }
- };
- }
- LocaleResolutionCallback resolution({Locale fallback}) {
- return (Locale locale, Iterable<Locale> supported) {
- return _resolve(locale, fallback, supported);
- };
- }
- Locale _resolve(Locale locale, Locale fallback, Iterable<Locale> supported) {
- if (locale == null || !isSupported(locale)) {
- return fallback ?? supported.first;
- }
- final Locale languageLocale = Locale(locale.languageCode, "");
- if (supported.contains(locale)) {
- return locale;
- } else if (supported.contains(languageLocale)) {
- return languageLocale;
- } else {
- final Locale fallbackLocale = fallback ?? supported.first;
- return fallbackLocale;
- }
- }
- @override
- Future<S> load(Locale locale) {
- final String lang = getLang(locale);
- if (lang != null) {
- switch (lang) {
- case "en":
- return SynchronousFuture<S>(const $en());
- case "zh_CN":
- return SynchronousFuture<S>(const $zh_CN());
- default:
- // NO-OP.
- }
- }
- return SynchronousFuture<S>(const S());
- }
- @override
- bool isSupported(Locale locale) =>
- locale != null && supportedLocales.contains(locale);
- @override
- bool shouldReload(GeneratedLocalizationsDelegate old) => false;
- }
- String getLang(Locale l) => l == null
- ? null
- : l.countryCode != null && l.countryCode.isEmpty
- ? l.languageCode
- : l.toString();
|