Template
chore: 初始化脚手架 — sunny_mochi 企业级 Flutter 模板
Core 基础设施:Flavor 三包体系、Drift+SQLCipher 加密数据库 7 拦截器 Dio 网络栈、CrashReporter 崩溃日志、Sealed Failure 错误体系 5 色板主题系统、Auth 认证骨架(Clean Architecture)、Dev Panel、Mock Adapter 通过验证:flutter analyze(0 errors)、flutter test(全绿)、staging APK 74.8MB
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"tab": {
|
||||
"home": "Home",
|
||||
"mine": "Mine"
|
||||
},
|
||||
"button": {
|
||||
"confirm": "Confirm",
|
||||
"cancel": "Cancel",
|
||||
"retry": "Retry",
|
||||
"submit": "Submit",
|
||||
"save": "Save",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"back": "Back",
|
||||
"close": "Close",
|
||||
"login": "Login",
|
||||
"logout": "Logout"
|
||||
},
|
||||
"error": {
|
||||
"unknown": "Something went wrong, please try again",
|
||||
"network": "Network connection failed",
|
||||
"timeout": "Request timed out",
|
||||
"server": "Server error, please try again",
|
||||
"auth": "Session expired, please login again",
|
||||
"empty_input": "Please fill in required fields",
|
||||
"invalid_phone": "Please enter a valid phone number"
|
||||
},
|
||||
"empty": {
|
||||
"default": "No data",
|
||||
"list": "List is empty"
|
||||
},
|
||||
"auth": {
|
||||
"login_title": "Welcome",
|
||||
"phone_hint": "Enter phone number",
|
||||
"code_hint": "Enter verification code",
|
||||
"password_hint": "Enter password",
|
||||
"send_code": "Send Code",
|
||||
"resend_code": "Resend",
|
||||
"sms_tab": "SMS Code",
|
||||
"pwd_tab": "Password"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/// Generated file. Do not edit.
|
||||
///
|
||||
/// Source: lib/i18n
|
||||
/// To regenerate, run: `dart run slang`
|
||||
///
|
||||
/// Locales: 2
|
||||
/// Strings: 60 (30 per locale)
|
||||
///
|
||||
/// Built on 2026-05-14 at 04:33 UTC
|
||||
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint, unused_import
|
||||
// dart format off
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:slang/generated.dart';
|
||||
import 'package:slang_flutter/slang_flutter.dart';
|
||||
export 'package:slang_flutter/slang_flutter.dart';
|
||||
|
||||
import 'strings_en.g.dart' deferred as l_en;
|
||||
part 'strings_zh_CN.g.dart';
|
||||
|
||||
/// Supported locales.
|
||||
///
|
||||
/// Usage:
|
||||
/// - LocaleSettings.setLocale(AppLocale.zhCn) // set locale
|
||||
/// - Locale locale = AppLocale.zhCn.flutterLocale // get flutter locale from enum
|
||||
/// - if (LocaleSettings.currentLocale == AppLocale.zhCn) // locale check
|
||||
enum AppLocale with BaseAppLocale<AppLocale, Translations> {
|
||||
zhCn(languageCode: 'zh', countryCode: 'CN'),
|
||||
en(languageCode: 'en');
|
||||
|
||||
const AppLocale({
|
||||
required this.languageCode,
|
||||
this.scriptCode, // ignore: unused_element, unused_element_parameter
|
||||
this.countryCode, // ignore: unused_element, unused_element_parameter
|
||||
});
|
||||
|
||||
@override final String languageCode;
|
||||
@override final String? scriptCode;
|
||||
@override final String? countryCode;
|
||||
|
||||
@override
|
||||
Future<Translations> build({
|
||||
Map<String, Node>? overrides,
|
||||
PluralResolver? cardinalResolver,
|
||||
PluralResolver? ordinalResolver,
|
||||
}) async {
|
||||
switch (this) {
|
||||
case AppLocale.zhCn:
|
||||
return TranslationsZhCn(
|
||||
overrides: overrides,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
case AppLocale.en:
|
||||
await l_en.loadLibrary();
|
||||
return l_en.TranslationsEn(
|
||||
overrides: overrides,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Translations buildSync({
|
||||
Map<String, Node>? overrides,
|
||||
PluralResolver? cardinalResolver,
|
||||
PluralResolver? ordinalResolver,
|
||||
}) {
|
||||
switch (this) {
|
||||
case AppLocale.zhCn:
|
||||
return TranslationsZhCn(
|
||||
overrides: overrides,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
case AppLocale.en:
|
||||
return l_en.TranslationsEn(
|
||||
overrides: overrides,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Gets current instance managed by [LocaleSettings].
|
||||
Translations get translations => LocaleSettings.instance.getTranslations(this);
|
||||
}
|
||||
|
||||
/// Method A: Simple
|
||||
///
|
||||
/// No rebuild after locale change.
|
||||
/// Translation happens during initialization of the widget (call of t).
|
||||
/// Configurable via 'translate_var'.
|
||||
///
|
||||
/// Usage:
|
||||
/// String a = t.someKey.anotherKey;
|
||||
/// String b = t['someKey.anotherKey']; // Only for edge cases!
|
||||
Translations get t => LocaleSettings.instance.currentTranslations;
|
||||
|
||||
/// Method B: Advanced
|
||||
///
|
||||
/// All widgets using this method will trigger a rebuild when locale changes.
|
||||
/// Use this if you have e.g. a settings page where the user can select the locale during runtime.
|
||||
///
|
||||
/// Step 1:
|
||||
/// wrap your App with
|
||||
/// TranslationProvider(
|
||||
/// child: MyApp()
|
||||
/// );
|
||||
///
|
||||
/// Step 2:
|
||||
/// final t = Translations.of(context); // Get t variable.
|
||||
/// String a = t.someKey.anotherKey; // Use t variable.
|
||||
/// String b = t['someKey.anotherKey']; // Only for edge cases!
|
||||
class TranslationProvider extends BaseTranslationProvider<AppLocale, Translations> {
|
||||
TranslationProvider({required super.child}) : super(settings: LocaleSettings.instance);
|
||||
|
||||
static InheritedLocaleData<AppLocale, Translations> of(BuildContext context) => InheritedLocaleData.of<AppLocale, Translations>(context);
|
||||
}
|
||||
|
||||
/// Method B shorthand via [BuildContext] extension method.
|
||||
/// Configurable via 'translate_var'.
|
||||
///
|
||||
/// Usage (e.g. in a widget's build method):
|
||||
/// context.t.someKey.anotherKey
|
||||
extension BuildContextTranslationsExtension on BuildContext {
|
||||
Translations get t => TranslationProvider.of(this).translations;
|
||||
}
|
||||
|
||||
/// Manages all translation instances and the current locale
|
||||
class LocaleSettings extends BaseFlutterLocaleSettings<AppLocale, Translations> {
|
||||
LocaleSettings._() : super(
|
||||
utils: AppLocaleUtils.instance,
|
||||
lazy: true,
|
||||
);
|
||||
|
||||
static final instance = LocaleSettings._();
|
||||
|
||||
// static aliases (checkout base methods for documentation)
|
||||
static AppLocale get currentLocale => instance.currentLocale;
|
||||
static Stream<AppLocale> getLocaleStream() => instance.getLocaleStream();
|
||||
static Future<AppLocale> setLocale(AppLocale locale, {bool? listenToDeviceLocale = false}) => instance.setLocale(locale, listenToDeviceLocale: listenToDeviceLocale);
|
||||
static Future<AppLocale> setLocaleRaw(String rawLocale, {bool? listenToDeviceLocale = false}) => instance.setLocaleRaw(rawLocale, listenToDeviceLocale: listenToDeviceLocale);
|
||||
static Future<AppLocale> useDeviceLocale() => instance.useDeviceLocale();
|
||||
static Future<void> setPluralResolver({String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) => instance.setPluralResolver(
|
||||
language: language,
|
||||
locale: locale,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
|
||||
// synchronous versions
|
||||
static AppLocale setLocaleSync(AppLocale locale, {bool? listenToDeviceLocale = false}) => instance.setLocaleSync(locale, listenToDeviceLocale: listenToDeviceLocale);
|
||||
static AppLocale setLocaleRawSync(String rawLocale, {bool? listenToDeviceLocale = false}) => instance.setLocaleRawSync(rawLocale, listenToDeviceLocale: listenToDeviceLocale);
|
||||
static AppLocale useDeviceLocaleSync() => instance.useDeviceLocaleSync();
|
||||
static void setPluralResolverSync({String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) => instance.setPluralResolverSync(
|
||||
language: language,
|
||||
locale: locale,
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
);
|
||||
}
|
||||
|
||||
/// Provides utility functions without any side effects.
|
||||
class AppLocaleUtils extends BaseAppLocaleUtils<AppLocale, Translations> {
|
||||
AppLocaleUtils._() : super(
|
||||
baseLocale: AppLocale.zhCn,
|
||||
locales: AppLocale.values,
|
||||
);
|
||||
|
||||
static final instance = AppLocaleUtils._();
|
||||
|
||||
// static aliases (checkout base methods for documentation)
|
||||
static AppLocale parse(String rawLocale) => instance.parse(rawLocale);
|
||||
static AppLocale parseLocaleParts({required String languageCode, String? scriptCode, String? countryCode}) => instance.parseLocaleParts(languageCode: languageCode, scriptCode: scriptCode, countryCode: countryCode);
|
||||
static AppLocale findDeviceLocale() => instance.findDeviceLocale();
|
||||
static List<Locale> get supportedLocales => instance.supportedLocales;
|
||||
static List<String> get supportedLocalesRaw => instance.supportedLocalesRaw;
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
///
|
||||
/// Generated file. Do not edit.
|
||||
///
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint, unused_import
|
||||
// dart format off
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:slang/generated.dart';
|
||||
import 'strings.g.dart';
|
||||
|
||||
// Path: <root>
|
||||
class TranslationsEn extends Translations with BaseTranslations<AppLocale, Translations> {
|
||||
/// You can call this constructor and build your own translation instance of this locale.
|
||||
/// Constructing via the enum [AppLocale.build] is preferred.
|
||||
TranslationsEn({Map<String, Node>? overrides, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver, TranslationMetadata<AppLocale, Translations>? meta})
|
||||
: assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'),
|
||||
$meta = meta ?? TranslationMetadata(
|
||||
locale: AppLocale.en,
|
||||
overrides: overrides ?? {},
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
),
|
||||
super(cardinalResolver: cardinalResolver, ordinalResolver: ordinalResolver) {
|
||||
super.$meta.setFlatMapFunction($meta.getTranslation); // copy base translations to super.$meta
|
||||
$meta.setFlatMapFunction(_flatMapFunction);
|
||||
}
|
||||
|
||||
/// Metadata for the translations of <en>.
|
||||
@override final TranslationMetadata<AppLocale, Translations> $meta;
|
||||
|
||||
/// Access flat map
|
||||
@override dynamic operator[](String key) => $meta.getTranslation(key) ?? super.$meta.getTranslation(key);
|
||||
|
||||
late final TranslationsEn _root = this; // ignore: unused_field
|
||||
|
||||
@override
|
||||
TranslationsEn $copyWith({TranslationMetadata<AppLocale, Translations>? meta}) => TranslationsEn(meta: meta ?? this.$meta);
|
||||
|
||||
// Translations
|
||||
@override late final _TranslationsTabEn tab = _TranslationsTabEn._(_root);
|
||||
@override late final _TranslationsButtonEn button = _TranslationsButtonEn._(_root);
|
||||
@override late final _TranslationsErrorEn error = _TranslationsErrorEn._(_root);
|
||||
@override late final _TranslationsEmptyEn empty = _TranslationsEmptyEn._(_root);
|
||||
@override late final _TranslationsAuthEn auth = _TranslationsAuthEn._(_root);
|
||||
}
|
||||
|
||||
// Path: tab
|
||||
class _TranslationsTabEn extends TranslationsTabZhCn {
|
||||
_TranslationsTabEn._(TranslationsEn root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsEn _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get home => 'Home';
|
||||
@override String get mine => 'Mine';
|
||||
}
|
||||
|
||||
// Path: button
|
||||
class _TranslationsButtonEn extends TranslationsButtonZhCn {
|
||||
_TranslationsButtonEn._(TranslationsEn root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsEn _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get confirm => 'Confirm';
|
||||
@override String get cancel => 'Cancel';
|
||||
@override String get retry => 'Retry';
|
||||
@override String get submit => 'Submit';
|
||||
@override String get save => 'Save';
|
||||
@override String get edit => 'Edit';
|
||||
@override String get delete => 'Delete';
|
||||
@override String get back => 'Back';
|
||||
@override String get close => 'Close';
|
||||
@override String get login => 'Login';
|
||||
@override String get logout => 'Logout';
|
||||
}
|
||||
|
||||
// Path: error
|
||||
class _TranslationsErrorEn extends TranslationsErrorZhCn {
|
||||
_TranslationsErrorEn._(TranslationsEn root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsEn _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get unknown => 'Something went wrong, please try again';
|
||||
@override String get network => 'Network connection failed';
|
||||
@override String get timeout => 'Request timed out';
|
||||
@override String get server => 'Server error, please try again';
|
||||
@override String get auth => 'Session expired, please login again';
|
||||
@override String get empty_input => 'Please fill in required fields';
|
||||
@override String get invalid_phone => 'Please enter a valid phone number';
|
||||
}
|
||||
|
||||
// Path: empty
|
||||
class _TranslationsEmptyEn extends TranslationsEmptyZhCn {
|
||||
_TranslationsEmptyEn._(TranslationsEn root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsEn _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get kDefault => 'No data';
|
||||
@override String get list => 'List is empty';
|
||||
}
|
||||
|
||||
// Path: auth
|
||||
class _TranslationsAuthEn extends TranslationsAuthZhCn {
|
||||
_TranslationsAuthEn._(TranslationsEn root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsEn _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get login_title => 'Welcome';
|
||||
@override String get phone_hint => 'Enter phone number';
|
||||
@override String get code_hint => 'Enter verification code';
|
||||
@override String get password_hint => 'Enter password';
|
||||
@override String get send_code => 'Send Code';
|
||||
@override String get resend_code => 'Resend';
|
||||
@override String get sms_tab => 'SMS Code';
|
||||
@override String get pwd_tab => 'Password';
|
||||
}
|
||||
|
||||
/// The flat map containing all translations for locale <en>.
|
||||
/// Only for edge cases! For simple maps, use the map function of this library.
|
||||
///
|
||||
/// The Dart AOT compiler has issues with very large switch statements,
|
||||
/// so the map is split into smaller functions (512 entries each).
|
||||
extension on TranslationsEn {
|
||||
dynamic _flatMapFunction(String path) {
|
||||
return switch (path) {
|
||||
'tab.home' => 'Home',
|
||||
'tab.mine' => 'Mine',
|
||||
'button.confirm' => 'Confirm',
|
||||
'button.cancel' => 'Cancel',
|
||||
'button.retry' => 'Retry',
|
||||
'button.submit' => 'Submit',
|
||||
'button.save' => 'Save',
|
||||
'button.edit' => 'Edit',
|
||||
'button.delete' => 'Delete',
|
||||
'button.back' => 'Back',
|
||||
'button.close' => 'Close',
|
||||
'button.login' => 'Login',
|
||||
'button.logout' => 'Logout',
|
||||
'error.unknown' => 'Something went wrong, please try again',
|
||||
'error.network' => 'Network connection failed',
|
||||
'error.timeout' => 'Request timed out',
|
||||
'error.server' => 'Server error, please try again',
|
||||
'error.auth' => 'Session expired, please login again',
|
||||
'error.empty_input' => 'Please fill in required fields',
|
||||
'error.invalid_phone' => 'Please enter a valid phone number',
|
||||
'empty.kDefault' => 'No data',
|
||||
'empty.list' => 'List is empty',
|
||||
'auth.login_title' => 'Welcome',
|
||||
'auth.phone_hint' => 'Enter phone number',
|
||||
'auth.code_hint' => 'Enter verification code',
|
||||
'auth.password_hint' => 'Enter password',
|
||||
'auth.send_code' => 'Send Code',
|
||||
'auth.resend_code' => 'Resend',
|
||||
'auth.sms_tab' => 'SMS Code',
|
||||
'auth.pwd_tab' => 'Password',
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
///
|
||||
/// Generated file. Do not edit.
|
||||
///
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint, unused_import
|
||||
// dart format off
|
||||
|
||||
part of 'strings.g.dart';
|
||||
|
||||
// Path: <root>
|
||||
typedef TranslationsZhCn = Translations; // ignore: unused_element
|
||||
class Translations with BaseTranslations<AppLocale, Translations> {
|
||||
/// Returns the current translations of the given [context].
|
||||
///
|
||||
/// Usage:
|
||||
/// final t = Translations.of(context);
|
||||
static Translations of(BuildContext context) => InheritedLocaleData.of<AppLocale, Translations>(context).translations;
|
||||
|
||||
/// You can call this constructor and build your own translation instance of this locale.
|
||||
/// Constructing via the enum [AppLocale.build] is preferred.
|
||||
Translations({Map<String, Node>? overrides, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver, TranslationMetadata<AppLocale, Translations>? meta})
|
||||
: assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'),
|
||||
$meta = meta ?? TranslationMetadata(
|
||||
locale: AppLocale.zhCn,
|
||||
overrides: overrides ?? {},
|
||||
cardinalResolver: cardinalResolver,
|
||||
ordinalResolver: ordinalResolver,
|
||||
) {
|
||||
$meta.setFlatMapFunction(_flatMapFunction);
|
||||
}
|
||||
|
||||
/// Metadata for the translations of <zh-CN>.
|
||||
@override final TranslationMetadata<AppLocale, Translations> $meta;
|
||||
|
||||
/// Access flat map
|
||||
dynamic operator[](String key) => $meta.getTranslation(key);
|
||||
|
||||
late final Translations _root = this; // ignore: unused_field
|
||||
|
||||
Translations $copyWith({TranslationMetadata<AppLocale, Translations>? meta}) => Translations(meta: meta ?? this.$meta);
|
||||
|
||||
// Translations
|
||||
late final TranslationsTabZhCn tab = TranslationsTabZhCn.internal(_root);
|
||||
late final TranslationsButtonZhCn button = TranslationsButtonZhCn.internal(_root);
|
||||
late final TranslationsErrorZhCn error = TranslationsErrorZhCn.internal(_root);
|
||||
late final TranslationsEmptyZhCn empty = TranslationsEmptyZhCn.internal(_root);
|
||||
late final TranslationsAuthZhCn auth = TranslationsAuthZhCn.internal(_root);
|
||||
}
|
||||
|
||||
// Path: tab
|
||||
class TranslationsTabZhCn {
|
||||
TranslationsTabZhCn.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// zh-CN: '首页'
|
||||
String get home => '首页';
|
||||
|
||||
/// zh-CN: '我的'
|
||||
String get mine => '我的';
|
||||
}
|
||||
|
||||
// Path: button
|
||||
class TranslationsButtonZhCn {
|
||||
TranslationsButtonZhCn.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// zh-CN: '确定'
|
||||
String get confirm => '确定';
|
||||
|
||||
/// zh-CN: '取消'
|
||||
String get cancel => '取消';
|
||||
|
||||
/// zh-CN: '重试'
|
||||
String get retry => '重试';
|
||||
|
||||
/// zh-CN: '提交'
|
||||
String get submit => '提交';
|
||||
|
||||
/// zh-CN: '保存'
|
||||
String get save => '保存';
|
||||
|
||||
/// zh-CN: '编辑'
|
||||
String get edit => '编辑';
|
||||
|
||||
/// zh-CN: '删除'
|
||||
String get delete => '删除';
|
||||
|
||||
/// zh-CN: '返回'
|
||||
String get back => '返回';
|
||||
|
||||
/// zh-CN: '关闭'
|
||||
String get close => '关闭';
|
||||
|
||||
/// zh-CN: '登录'
|
||||
String get login => '登录';
|
||||
|
||||
/// zh-CN: '退出登录'
|
||||
String get logout => '退出登录';
|
||||
}
|
||||
|
||||
// Path: error
|
||||
class TranslationsErrorZhCn {
|
||||
TranslationsErrorZhCn.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// zh-CN: '出现了一点问题,请稍后重试'
|
||||
String get unknown => '出现了一点问题,请稍后重试';
|
||||
|
||||
/// zh-CN: '网络连接失败,请检查网络'
|
||||
String get network => '网络连接失败,请检查网络';
|
||||
|
||||
/// zh-CN: '请求超时,请稍后重试'
|
||||
String get timeout => '请求超时,请稍后重试';
|
||||
|
||||
/// zh-CN: '服务器开小差了,请稍后重试'
|
||||
String get server => '服务器开小差了,请稍后重试';
|
||||
|
||||
/// zh-CN: '登录已过期,请重新登录'
|
||||
String get auth => '登录已过期,请重新登录';
|
||||
|
||||
/// zh-CN: '请填写必填项'
|
||||
String get empty_input => '请填写必填项';
|
||||
|
||||
/// zh-CN: '请输入有效的手机号'
|
||||
String get invalid_phone => '请输入有效的手机号';
|
||||
}
|
||||
|
||||
// Path: empty
|
||||
class TranslationsEmptyZhCn {
|
||||
TranslationsEmptyZhCn.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// zh-CN: '暂无数据'
|
||||
String get kDefault => '暂无数据';
|
||||
|
||||
/// zh-CN: '列表为空'
|
||||
String get list => '列表为空';
|
||||
}
|
||||
|
||||
// Path: auth
|
||||
class TranslationsAuthZhCn {
|
||||
TranslationsAuthZhCn.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// zh-CN: '欢迎登录'
|
||||
String get login_title => '欢迎登录';
|
||||
|
||||
/// zh-CN: '请输入手机号'
|
||||
String get phone_hint => '请输入手机号';
|
||||
|
||||
/// zh-CN: '请输入验证码'
|
||||
String get code_hint => '请输入验证码';
|
||||
|
||||
/// zh-CN: '请输入密码'
|
||||
String get password_hint => '请输入密码';
|
||||
|
||||
/// zh-CN: '发送验证码'
|
||||
String get send_code => '发送验证码';
|
||||
|
||||
/// zh-CN: '重新发送'
|
||||
String get resend_code => '重新发送';
|
||||
|
||||
/// zh-CN: '短信验证码'
|
||||
String get sms_tab => '短信验证码';
|
||||
|
||||
/// zh-CN: '密码登录'
|
||||
String get pwd_tab => '密码登录';
|
||||
}
|
||||
|
||||
/// The flat map containing all translations for locale <zh-CN>.
|
||||
/// Only for edge cases! For simple maps, use the map function of this library.
|
||||
///
|
||||
/// The Dart AOT compiler has issues with very large switch statements,
|
||||
/// so the map is split into smaller functions (512 entries each).
|
||||
extension on Translations {
|
||||
dynamic _flatMapFunction(String path) {
|
||||
return switch (path) {
|
||||
'tab.home' => '首页',
|
||||
'tab.mine' => '我的',
|
||||
'button.confirm' => '确定',
|
||||
'button.cancel' => '取消',
|
||||
'button.retry' => '重试',
|
||||
'button.submit' => '提交',
|
||||
'button.save' => '保存',
|
||||
'button.edit' => '编辑',
|
||||
'button.delete' => '删除',
|
||||
'button.back' => '返回',
|
||||
'button.close' => '关闭',
|
||||
'button.login' => '登录',
|
||||
'button.logout' => '退出登录',
|
||||
'error.unknown' => '出现了一点问题,请稍后重试',
|
||||
'error.network' => '网络连接失败,请检查网络',
|
||||
'error.timeout' => '请求超时,请稍后重试',
|
||||
'error.server' => '服务器开小差了,请稍后重试',
|
||||
'error.auth' => '登录已过期,请重新登录',
|
||||
'error.empty_input' => '请填写必填项',
|
||||
'error.invalid_phone' => '请输入有效的手机号',
|
||||
'empty.kDefault' => '暂无数据',
|
||||
'empty.list' => '列表为空',
|
||||
'auth.login_title' => '欢迎登录',
|
||||
'auth.phone_hint' => '请输入手机号',
|
||||
'auth.code_hint' => '请输入验证码',
|
||||
'auth.password_hint' => '请输入密码',
|
||||
'auth.send_code' => '发送验证码',
|
||||
'auth.resend_code' => '重新发送',
|
||||
'auth.sms_tab' => '短信验证码',
|
||||
'auth.pwd_tab' => '密码登录',
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"tab": {
|
||||
"home": "首页",
|
||||
"mine": "我的"
|
||||
},
|
||||
"button": {
|
||||
"confirm": "确定",
|
||||
"cancel": "取消",
|
||||
"retry": "重试",
|
||||
"submit": "提交",
|
||||
"save": "保存",
|
||||
"edit": "编辑",
|
||||
"delete": "删除",
|
||||
"back": "返回",
|
||||
"close": "关闭",
|
||||
"login": "登录",
|
||||
"logout": "退出登录"
|
||||
},
|
||||
"error": {
|
||||
"unknown": "出现了一点问题,请稍后重试",
|
||||
"network": "网络连接失败,请检查网络",
|
||||
"timeout": "请求超时,请稍后重试",
|
||||
"server": "服务器开小差了,请稍后重试",
|
||||
"auth": "登录已过期,请重新登录",
|
||||
"empty_input": "请填写必填项",
|
||||
"invalid_phone": "请输入有效的手机号"
|
||||
},
|
||||
"empty": {
|
||||
"default": "暂无数据",
|
||||
"list": "列表为空"
|
||||
},
|
||||
"auth": {
|
||||
"login_title": "欢迎登录",
|
||||
"phone_hint": "请输入手机号",
|
||||
"code_hint": "请输入验证码",
|
||||
"password_hint": "请输入密码",
|
||||
"send_code": "发送验证码",
|
||||
"resend_code": "重新发送",
|
||||
"sms_tab": "短信验证码",
|
||||
"pwd_tab": "密码登录"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user