Created
May 21, 2020 16:56
-
-
Save freedive-cebu30/c0f2685ea3a1fc86eae7c58854f22af6 to your computer and use it in GitHub Desktop.
flutter_localizations_4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/foundation.dart' show SynchronousFuture; | |
import 'package:flutter/material.dart'; | |
import 'i18n.dart'; | |
class I18nDelegate extends LocalizationsDelegate<I18n> { | |
const I18nDelegate(); | |
@override | |
bool isSupported(Locale locale) => ['en', 'ja'].contains(locale.languageCode); | |
@override | |
Future<I18n> load(Locale locale) { | |
return SynchronousFuture<I18n>(I18n(locale)); | |
} | |
@override | |
bool shouldReload(I18nDelegate old) => false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment