Skip to content

Instantly share code, notes, and snippets.

@freedive-cebu30
Created May 21, 2020 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freedive-cebu30/c0f2685ea3a1fc86eae7c58854f22af6 to your computer and use it in GitHub Desktop.
Save freedive-cebu30/c0f2685ea3a1fc86eae7c58854f22af6 to your computer and use it in GitHub Desktop.
flutter_localizations_4
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