Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

110 righe
2.7 KiB

  1. // GENERATED CODE - DO NOT MODIFY BY HAND
  2. import 'package:flutter/material.dart';
  3. import 'package:intl/intl.dart';
  4. import 'intl/messages_all.dart';
  5. // **************************************************************************
  6. // Generator: Flutter Intl IDE plugin
  7. // Made by Localizely
  8. // **************************************************************************
  9. // ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars
  10. // ignore_for_file: join_return_with_assignment, prefer_final_in_for_each
  11. // ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes
  12. class S {
  13. S();
  14. static S? _current;
  15. static S get current {
  16. assert(_current != null,
  17. 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.');
  18. return _current!;
  19. }
  20. static const AppLocalizationDelegate delegate = AppLocalizationDelegate();
  21. static Future<S> load(Locale locale) {
  22. final name = (locale.countryCode?.isEmpty ?? false)
  23. ? locale.languageCode
  24. : locale.toString();
  25. final localeName = Intl.canonicalizedLocale(name);
  26. return initializeMessages(localeName).then((_) {
  27. Intl.defaultLocale = localeName;
  28. final instance = S();
  29. S._current = instance;
  30. return instance;
  31. });
  32. }
  33. static S of(BuildContext context) {
  34. final instance = S.maybeOf(context);
  35. assert(instance != null,
  36. 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?');
  37. return instance!;
  38. }
  39. static S? maybeOf(BuildContext context) {
  40. return Localizations.of<S>(context, S);
  41. }
  42. /// `home`
  43. String get bottomNavHome {
  44. return Intl.message(
  45. 'home',
  46. name: 'bottomNavHome',
  47. desc: '',
  48. args: [],
  49. );
  50. }
  51. /// `sleep`
  52. String get bottomNavSleep {
  53. return Intl.message(
  54. 'sleep',
  55. name: 'bottomNavSleep',
  56. desc: '',
  57. args: [],
  58. );
  59. }
  60. /// `profile`
  61. String get bottomNavProfile {
  62. return Intl.message(
  63. 'profile',
  64. name: 'bottomNavProfile',
  65. desc: '',
  66. args: [],
  67. );
  68. }
  69. }
  70. class AppLocalizationDelegate extends LocalizationsDelegate<S> {
  71. const AppLocalizationDelegate();
  72. List<Locale> get supportedLocales {
  73. return const <Locale>[
  74. Locale.fromSubtags(languageCode: 'en'),
  75. Locale.fromSubtags(languageCode: 'zh'),
  76. ];
  77. }
  78. @override
  79. bool isSupported(Locale locale) => _isSupported(locale);
  80. @override
  81. Future<S> load(Locale locale) => S.load(locale);
  82. @override
  83. bool shouldReload(AppLocalizationDelegate old) => false;
  84. bool _isSupported(Locale locale) {
  85. for (var supportedLocale in supportedLocales) {
  86. if (supportedLocale.languageCode == locale.languageCode) {
  87. return true;
  88. }
  89. }
  90. return false;
  91. }
  92. }