当前位置:   article > 正文

Flutter工具类(五) 国际化_no instance of s was loaded. try to initialize the

no instance of s was loaded. try to initialize the s delegate before accessi

导入依赖

#国际化
  intl: ^0.17.0
  • 1
  • 2

工具类

messages_all.dart


import 'dart:async';

import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
import 'package:intl/src/intl_helpers.dart';

import 'messages_en.dart' as messages_en;
import 'messages_zh.dart' as messages_zh;

typedef Future<dynamic> LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
  'en': () => new Future.value(null),
  'zh': () => new Future.value(null),
};

MessageLookupByLibrary? _findExact(String localeName) {
  switch (localeName) {
    case 'en':
      return messages_en.messages;
    case 'zh':
      return messages_zh.messages;
    default:
      return null;
  }
}

/// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) async {
  var availableLocale = Intl.verifiedLocale(
      localeName, (locale) => _deferredLibraries[locale] != null,
      onFailure: (_) => null);
  if (availableLocale == null) {
    return new Future.value(false);
  }
  var lib = _deferredLibraries[availableLocale];
  await (lib == null ? new Future.value(false) : lib());
  initializeInternalMessageLookup(() => new CompositeMessageLookup());
  messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
  return new Future.value(true);
}

bool _messagesExistFor(String locale) {
  try {
    return _findExact(locale) != null;
  } catch (e) {
    return false;
  }
}

MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
  var actualLocale =
      Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
  if (actualLocale == null) return null;
  return _findExact(actualLocale);
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57

messages_en.dart

// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that provides messages for a en locale. All the
// messages from the main program should be duplicated here with the same
// function name.

// Ignore issues from commonly used lints in this file.
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes

import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';

final messages = new MessageLookup();

typedef String MessageIfAbsent(String messageStr, List<dynamic> args);

class MessageLookup extends MessageLookupByLibrary {
  String get localeName => 'en';

  static String m0(value) => "Integral:${value}";

  static String m1(main, sub) => "${main} - ${sub}";

  static String m2(progress) => "Learned${progress}%";

  final messages = _notInlinedMessages(_notInlinedMessages);
  static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
        "account_empty_tip":
            MessageLookupByLibrary.simpleMessage("Please enter an account"),
        "cancel": MessageLookupByLibrary.simpleMessage("Cancel"),
        "clean_all": MessageLookupByLibrary.simpleMessage("Clear all"),
        "collect": MessageLookupByLibrary.simpleMessage("Collect"),
        "collect_content": MessageLookupByLibrary.simpleMessage(
            "Are you sure remove the collected content?"),
        "color_theme": MessageLookupByLibrary.simpleMessage("Color Theme"),
        "confirm": MessageLookupByLibrary.simpleMessage("Confirm"),
        "dark_style": MessageLookupByLibrary.simpleMessage("Dark Mode"),
        "done": MessageLookupByLibrary.simpleMessage("Done"),
        "edit": MessageLookupByLibrary.simpleMessage("Edit"),
        "integral": m0,
        "label_group": m1,
        "language_chinese": MessageLookupByLibrary.simpleMessage("Chinese"),
        "language_english": MessageLookupByLibrary.simpleMessage("English"),
        "learn_no": MessageLookupByLibrary.simpleMessage("No learned"),
        "learn_progress": m2,
        "loading_content":
            MessageLookupByLibrary.simpleMessage("content loading..."),
        "login": MessageLookupByLibrary.simpleMessage("Login"),
        "login_success": MessageLookupByLibrary.simpleMessage("Login success"),
        "multi_language":
            MessageLookupByLibrary.simpleMessage("Multi language"),
        "net_error": MessageLookupByLibrary.simpleMessage("Network error"),
        "no_account": MessageLookupByLibrary.simpleMessage("No account yet?"),
        "placeholder": MessageLookupByLibrary.simpleMessage("--"),
        "psw_confirm_empty_tip":
            MessageLookupByLibrary.simpleMessage("Please confirm the password"),
        "psw_confirm_tip": MessageLookupByLibrary.simpleMessage(
            "Two passwords are inconsistent"),
        "psw_empty_tip":
            MessageLookupByLibrary.simpleMessage("Please enter an password"),
        "register": MessageLookupByLibrary.simpleMessage("Register"),
        "register_now": MessageLookupByLibrary.simpleMessage("Register now"),
        "register_success":
            MessageLookupByLibrary.simpleMessage("Register success"),
        "search_hint": MessageLookupByLibrary.simpleMessage(
            "separate multiple keywords with spaces"),
        "search_hot_title":
            MessageLookupByLibrary.simpleMessage("Popular search"),
        "search_local_title":
            MessageLookupByLibrary.simpleMessage("Historical search"),
        "settings": MessageLookupByLibrary.simpleMessage("Settings"),
        "tab_book": MessageLookupByLibrary.simpleMessage("Book"),
        "tab_book_course":
            MessageLookupByLibrary.simpleMessage("Book tutorial"),
        "tab_home": MessageLookupByLibrary.simpleMessage("Home"),
        "tab_knowledge": MessageLookupByLibrary.simpleMessage("Knowledge"),
        "tab_me": MessageLookupByLibrary.simpleMessage("Me"),
        "tab_nav": MessageLookupByLibrary.simpleMessage("Navigation"),
        "tab_project": MessageLookupByLibrary.simpleMessage("Project"),
        "tab_tree": MessageLookupByLibrary.simpleMessage("System"),
        "tips_msg": MessageLookupByLibrary.simpleMessage("Tips"),
        "topping": MessageLookupByLibrary.simpleMessage("Topping"),
        "user_name": MessageLookupByLibrary.simpleMessage("UserName"),
        "user_psw": MessageLookupByLibrary.simpleMessage("Password"),
        "user_psw_confirm":
            MessageLookupByLibrary.simpleMessage("Confirm Password")
      };
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92

messages_zh.dart

// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that provides messages for a zh locale. All the
// messages from the main program should be duplicated here with the same
// function name.

// Ignore issues from commonly used lints in this file.
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes

import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';

final messages = new MessageLookup();

typedef String MessageIfAbsent(String messageStr, List<dynamic> args);

class MessageLookup extends MessageLookupByLibrary {
  String get localeName => 'zh';

  static String m0(value) => "积分:${value}";

  static String m1(main, sub) => "${main} - ${sub}";

  static String m2(progress) => "已学${progress}%";

  final messages = _notInlinedMessages(_notInlinedMessages);
  static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
        "account_empty_tip": MessageLookupByLibrary.simpleMessage("请输入账号"),
        "cancel": MessageLookupByLibrary.simpleMessage("取消"),
        "clean_all": MessageLookupByLibrary.simpleMessage("清除全部"),
        "collect": MessageLookupByLibrary.simpleMessage("收藏"),
        "collect_content": MessageLookupByLibrary.simpleMessage("您确定要移除收藏内容吗?"),
        "color_theme": MessageLookupByLibrary.simpleMessage("彩色主题"),
        "confirm": MessageLookupByLibrary.simpleMessage("确定"),
        "dark_style": MessageLookupByLibrary.simpleMessage("暗黑模式"),
        "done": MessageLookupByLibrary.simpleMessage("完成"),
        "edit": MessageLookupByLibrary.simpleMessage("编辑"),
        "integral": m0,
        "label_group": m1,
        "language_chinese": MessageLookupByLibrary.simpleMessage("中文"),
        "language_english": MessageLookupByLibrary.simpleMessage("英文"),
        "learn_no": MessageLookupByLibrary.simpleMessage("未学习"),
        "learn_progress": m2,
        "loading_content": MessageLookupByLibrary.simpleMessage("内容加载中..."),
        "login": MessageLookupByLibrary.simpleMessage("登录"),
        "login_success": MessageLookupByLibrary.simpleMessage("登录成功"),
        "multi_language": MessageLookupByLibrary.simpleMessage("多语言"),
        "net_error": MessageLookupByLibrary.simpleMessage("网络错误"),
        "no_account": MessageLookupByLibrary.simpleMessage("还没账号?"),
        "placeholder": MessageLookupByLibrary.simpleMessage("--"),
        "psw_confirm_empty_tip": MessageLookupByLibrary.simpleMessage("请确认密码"),
        "psw_confirm_tip": MessageLookupByLibrary.simpleMessage("两次密码不一致"),
        "psw_empty_tip": MessageLookupByLibrary.simpleMessage("请输入密码"),
        "register": MessageLookupByLibrary.simpleMessage("注册"),
        "register_now": MessageLookupByLibrary.simpleMessage("立即注册"),
        "register_success": MessageLookupByLibrary.simpleMessage("注册成功"),
        "search_hint": MessageLookupByLibrary.simpleMessage("用空格分隔多个关键词"),
        "search_hot_title": MessageLookupByLibrary.simpleMessage("热门搜索"),
        "search_local_title": MessageLookupByLibrary.simpleMessage("历史搜索"),
        "settings": MessageLookupByLibrary.simpleMessage("设置"),
        "tab_book": MessageLookupByLibrary.simpleMessage("教程"),
        "tab_book_course": MessageLookupByLibrary.simpleMessage("书籍教程"),
        "tab_home": MessageLookupByLibrary.simpleMessage("首页"),
        "tab_knowledge": MessageLookupByLibrary.simpleMessage("知识"),
        "tab_me": MessageLookupByLibrary.simpleMessage("我的"),
        "tab_nav": MessageLookupByLibrary.simpleMessage("导航"),
        "tab_project": MessageLookupByLibrary.simpleMessage("项目"),
        "tab_tree": MessageLookupByLibrary.simpleMessage("体系"),
        "tips_msg": MessageLookupByLibrary.simpleMessage("提示"),
        "topping": MessageLookupByLibrary.simpleMessage("置顶"),
        "user_name": MessageLookupByLibrary.simpleMessage("用户名"),
        "user_psw": MessageLookupByLibrary.simpleMessage("密码"),
        "user_psw_confirm": MessageLookupByLibrary.simpleMessage("确认密码")
      };
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79

l10n.dart

import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'intl/messages_all.dart';

// **************************************************************************
// Generator: Flutter Intl IDE plugin
// Made by Localizely
// **************************************************************************

// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars
// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each
// ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes

class S {
  S();

  static S? _current;

  static S get current {
    assert(_current != null,
        'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.');
    return _current!;
  }

  static const AppLocalizationDelegate delegate = AppLocalizationDelegate();

  static Future<S> load(Locale locale) {
    final name = (locale.countryCode?.isEmpty ?? false)
        ? locale.languageCode
        : locale.toString();
    final localeName = Intl.canonicalizedLocale(name);
    return initializeMessages(localeName).then((_) {
      Intl.defaultLocale = localeName;
      final instance = S();
      S._current = instance;

      return instance;
    });
  }

  static S of(BuildContext context) {
    final instance = S.maybeOf(context);
    assert(instance != null,
        'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?');
    return instance!;
  }

  static S? maybeOf(BuildContext context) {
    return Localizations.of<S>(context, S);
  }

  /// `Home`
  String get tab_home {
    return Intl.message(
      'Home',
      name: 'tab_home',
      desc: '',
      args: [],
    );
  }

  /// `Project`
  String get tab_project {
    return Intl.message(
      'Project',
      name: 'tab_project',
      desc: '',
      args: [],
    );
  }

  /// `Knowledge`
  String get tab_knowledge {
    return Intl.message(
      'Knowledge',
      name: 'tab_knowledge',
      desc: '',
      args: [],
    );
  }

  /// `Book`
  String get tab_book {
    return Intl.message(
      'Book',
      name: 'tab_book',
      desc: '',
      args: [],
    );
  }

  /// `Me`
  String get tab_me {
    return Intl.message(
      'Me',
      name: 'tab_me',
      desc: '',
      args: [],
    );
  }

  /// `Integral:{value}`
  String integral(Object value) {
    return Intl.message(
      'Integral:$value',
      name: 'integral',
      desc: '',
      args: [value],
    );
  }

  /// `Collect`
  String get collect {
    return Intl.message(
      'Collect',
      name: 'collect',
      desc: '',
      args: [],
    );
  }

  /// `Dark Mode`
  String get dark_style {
    return Intl.message(
      'Dark Mode',
      name: 'dark_style',
      desc: '',
      args: [],
    );
  }

  /// `Color Theme`
  String get color_theme {
    return Intl.message(
      'Color Theme',
      name: 'color_theme',
      desc: '',
      args: [],
    );
  }

  /// `Settings`
  String get settings {
    return Intl.message(
      'Settings',
      name: 'settings',
      desc: '',
      args: [],
    );
  }

  /// `--`
  String get placeholder {
    return Intl.message(
      '--',
      name: 'placeholder',
      desc: '',
      args: [],
    );
  }

  /// `Login`
  String get login {
    return Intl.message(
      'Login',
      name: 'login',
      desc: '',
      args: [],
    );
  }

  /// `Register`
  String get register {
    return Intl.message(
      'Register',
      name: 'register',
      desc: '',
      args: [],
    );
  }

  /// `Register now`
  String get register_now {
    return Intl.message(
      'Register now',
      name: 'register_now',
      desc: '',
      args: [],
    );
  }

  /// `No account yet?`
  String get no_account {
    return Intl.message(
      'No account yet?',
      name: 'no_account',
      desc: '',
      args: [],
    );
  }

  /// `UserName`
  String get user_name {
    return Intl.message(
      'UserName',
      name: 'user_name',
      desc: '',
      args: [],
    );
  }

  /// `Password`
  String get user_psw {
    return Intl.message(
      'Password',
      name: 'user_psw',
      desc: '',
      args: [],
    );
  }

  /// `Confirm Password`
  String get user_psw_confirm {
    return Intl.message(
      'Confirm Password',
      name: 'user_psw_confirm',
      desc: '',
      args: [],
    );
  }

  /// `Topping`
  String get topping {
    return Intl.message(
      'Topping',
      name: 'topping',
      desc: '',
      args: [],
    );
  }

  /// `{main} - {sub}`
  String label_group(Object main, Object sub) {
    return Intl.message(
      '$main - $sub',
      name: 'label_group',
      desc: '',
      args: [main, sub],
    );
  }

  /// `separate multiple keywords with spaces`
  String get search_hint {
    return Intl.message(
      'separate multiple keywords with spaces',
      name: 'search_hint',
      desc: '',
      args: [],
    );
  }

  /// `Popular search`
  String get search_hot_title {
    return Intl.message(
      'Popular search',
      name: 'search_hot_title',
      desc: '',
      args: [],
    );
  }

  /// `Historical search`
  String get search_local_title {
    return Intl.message(
      'Historical search',
      name: 'search_local_title',
      desc: '',
      args: [],
    );
  }

  /// `Edit`
  String get edit {
    return Intl.message(
      'Edit',
      name: 'edit',
      desc: '',
      args: [],
    );
  }

  /// `Clear all`
  String get clean_all {
    return Intl.message(
      'Clear all',
      name: 'clean_all',
      desc: '',
      args: [],
    );
  }

  /// `Done`
  String get done {
    return Intl.message(
      'Done',
      name: 'done',
      desc: '',
      args: [],
    );
  }

  /// `content loading...`
  String get loading_content {
    return Intl.message(
      'content loading...',
      name: 'loading_content',
      desc: '',
      args: [],
    );
  }

  /// `Learned{progress}%`
  String learn_progress(Object progress) {
    return Intl.message(
      'Learned$progress%',
      name: 'learn_progress',
      desc: '',
      args: [progress],
    );
  }

  /// `No learned`
  String get learn_no {
    return Intl.message(
      'No learned',
      name: 'learn_no',
      desc: '',
      args: [],
    );
  }

  /// `Multi language`
  String get multi_language {
    return Intl.message(
      'Multi language',
      name: 'multi_language',
      desc: '',
      args: [],
    );
  }

  /// `Chinese`
  String get language_chinese {
    return Intl.message(
      'Chinese',
      name: 'language_chinese',
      desc: '',
      args: [],
    );
  }

  /// `English`
  String get language_english {
    return Intl.message(
      'English',
      name: 'language_english',
      desc: '',
      args: [],
    );
  }

  /// `Please enter an account`
  String get account_empty_tip {
    return Intl.message(
      'Please enter an account',
      name: 'account_empty_tip',
      desc: '',
      args: [],
    );
  }

  /// `Please enter an password`
  String get psw_empty_tip {
    return Intl.message(
      'Please enter an password',
      name: 'psw_empty_tip',
      desc: '',
      args: [],
    );
  }

  /// `Please confirm the password`
  String get psw_confirm_empty_tip {
    return Intl.message(
      'Please confirm the password',
      name: 'psw_confirm_empty_tip',
      desc: '',
      args: [],
    );
  }

  /// `Two passwords are inconsistent`
  String get psw_confirm_tip {
    return Intl.message(
      'Two passwords are inconsistent',
      name: 'psw_confirm_tip',
      desc: '',
      args: [],
    );
  }

  /// `Login success`
  String get login_success {
    return Intl.message(
      'Login success',
      name: 'login_success',
      desc: '',
      args: [],
    );
  }

  /// `Register success`
  String get register_success {
    return Intl.message(
      'Register success',
      name: 'register_success',
      desc: '',
      args: [],
    );
  }

  /// `Network error`
  String get net_error {
    return Intl.message(
      'Network error',
      name: 'net_error',
      desc: '',
      args: [],
    );
  }

  /// `System`
  String get tab_tree {
    return Intl.message(
      'System',
      name: 'tab_tree',
      desc: '',
      args: [],
    );
  }

  /// `Navigation`
  String get tab_nav {
    return Intl.message(
      'Navigation',
      name: 'tab_nav',
      desc: '',
      args: [],
    );
  }

  /// `Book tutorial`
  String get tab_book_course {
    return Intl.message(
      'Book tutorial',
      name: 'tab_book_course',
      desc: '',
      args: [],
    );
  }

  /// `Tips`
  String get tips_msg {
    return Intl.message(
      'Tips',
      name: 'tips_msg',
      desc: '',
      args: [],
    );
  }

  /// `Cancel`
  String get cancel {
    return Intl.message(
      'Cancel',
      name: 'cancel',
      desc: '',
      args: [],
    );
  }

  /// `Confirm`
  String get confirm {
    return Intl.message(
      'Confirm',
      name: 'confirm',
      desc: '',
      args: [],
    );
  }

  /// `Are you sure remove the collected content?`
  String get collect_content {
    return Intl.message(
      'Are you sure remove the collected content?',
      name: 'collect_content',
      desc: '',
      args: [],
    );
  }
}

class AppLocalizationDelegate extends LocalizationsDelegate<S> {
  const AppLocalizationDelegate();

  List<Locale> get supportedLocales {
    return const <Locale>[
      Locale.fromSubtags(languageCode: 'en'),
      Locale.fromSubtags(languageCode: 'zh'),
    ];
  }

  @override
  bool isSupported(Locale locale) => _isSupported(locale);
  @override
  Future<S> load(Locale locale) => S.load(locale);
  @override
  bool shouldReload(AppLocalizationDelegate old) => false;

  bool _isSupported(Locale locale) {
    for (var supportedLocale in supportedLocales) {
      if (supportedLocale.languageCode == locale.languageCode) {
        return true;
      }
    }
    return false;
  }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 269
  • 270
  • 271
  • 272
  • 273
  • 274
  • 275
  • 276
  • 277
  • 278
  • 279
  • 280
  • 281
  • 282
  • 283
  • 284
  • 285
  • 286
  • 287
  • 288
  • 289
  • 290
  • 291
  • 292
  • 293
  • 294
  • 295
  • 296
  • 297
  • 298
  • 299
  • 300
  • 301
  • 302
  • 303
  • 304
  • 305
  • 306
  • 307
  • 308
  • 309
  • 310
  • 311
  • 312
  • 313
  • 314
  • 315
  • 316
  • 317
  • 318
  • 319
  • 320
  • 321
  • 322
  • 323
  • 324
  • 325
  • 326
  • 327
  • 328
  • 329
  • 330
  • 331
  • 332
  • 333
  • 334
  • 335
  • 336
  • 337
  • 338
  • 339
  • 340
  • 341
  • 342
  • 343
  • 344
  • 345
  • 346
  • 347
  • 348
  • 349
  • 350
  • 351
  • 352
  • 353
  • 354
  • 355
  • 356
  • 357
  • 358
  • 359
  • 360
  • 361
  • 362
  • 363
  • 364
  • 365
  • 366
  • 367
  • 368
  • 369
  • 370
  • 371
  • 372
  • 373
  • 374
  • 375
  • 376
  • 377
  • 378
  • 379
  • 380
  • 381
  • 382
  • 383
  • 384
  • 385
  • 386
  • 387
  • 388
  • 389
  • 390
  • 391
  • 392
  • 393
  • 394
  • 395
  • 396
  • 397
  • 398
  • 399
  • 400
  • 401
  • 402
  • 403
  • 404
  • 405
  • 406
  • 407
  • 408
  • 409
  • 410
  • 411
  • 412
  • 413
  • 414
  • 415
  • 416
  • 417
  • 418
  • 419
  • 420
  • 421
  • 422
  • 423
  • 424
  • 425
  • 426
  • 427
  • 428
  • 429
  • 430
  • 431
  • 432
  • 433
  • 434
  • 435
  • 436
  • 437
  • 438
  • 439
  • 440
  • 441
  • 442
  • 443
  • 444
  • 445
  • 446
  • 447
  • 448
  • 449
  • 450
  • 451
  • 452
  • 453
  • 454
  • 455
  • 456
  • 457
  • 458
  • 459
  • 460
  • 461
  • 462
  • 463
  • 464
  • 465
  • 466
  • 467
  • 468
  • 469
  • 470
  • 471
  • 472
  • 473
  • 474
  • 475
  • 476
  • 477
  • 478
  • 479
  • 480
  • 481
  • 482
  • 483
  • 484
  • 485
  • 486
  • 487
  • 488
  • 489
  • 490
  • 491
  • 492
  • 493
  • 494
  • 495
  • 496
  • 497
  • 498
  • 499
  • 500
  • 501
  • 502
  • 503
  • 504
  • 505
  • 506
  • 507
  • 508
  • 509
  • 510
  • 511
  • 512
  • 513
  • 514
  • 515
  • 516
  • 517
  • 518
  • 519
  • 520
  • 521
  • 522
  • 523
  • 524
  • 525
  • 526
  • 527
  • 528
  • 529
  • 530
  • 531
  • 532
  • 533
  • 534
  • 535
  • 536
  • 537
  • 538

使用案列
main.dart

return MaterialApp(
        
            /// widget本地化代理设置
            localizationsDelegates: const [
              GlobalMaterialLocalizations.delegate,
              GlobalCupertinoLocalizations.delegate,
              GlobalWidgetsLocalizations.delegate,
              S.delegate //自定义国际化
            ],
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/一键难忘520/article/detail/913750
推荐阅读
相关标签
  

闽ICP备14008679号