From 6c2fb4c8842cd9c1c89afe1c080ffb8c96dd0b74 Mon Sep 17 00:00:00 2001 From: xuelongqy <59814509@qq.com> Date: Mon, 24 Dec 2018 17:27:51 +0800 Subject: [PATCH] Delete i18n.dart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去除多余文件 --- lib/generated/i18n.dart | 95 ----------------------------------------- 1 file changed, 95 deletions(-) delete mode 100644 lib/generated/i18n.dart diff --git a/lib/generated/i18n.dart b/lib/generated/i18n.dart deleted file mode 100644 index d7c6df18..00000000 --- a/lib/generated/i18n.dart +++ /dev/null @@ -1,95 +0,0 @@ -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(context, S); - - @override - TextDirection get textDirection => TextDirection.ltr; - -} - -class $en extends S { - const $en(); -} - -class GeneratedLocalizationsDelegate extends LocalizationsDelegate { - const GeneratedLocalizationsDelegate(); - - List get supportedLocales { - return const [ - Locale("en", ""), - ]; - } - - LocaleListResolutionCallback listResolution({Locale fallback}) { - return (List locales, Iterable 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 supported) { - return _resolve(locale, fallback, supported); - }; - } - - Locale _resolve(Locale locale, Locale fallback, Iterable 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 load(Locale locale) { - final String lang = getLang(locale); - if (lang != null) { - switch (lang) { - case "en": - return SynchronousFuture(const $en()); - default: - // NO-OP. - } - } - return SynchronousFuture(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();