Created
September 3, 2018 12:22
-
-
Save rohan20/620771ad80280b6e55a4fa5695c95ff5 to your computer and use it in GitHub Desktop.
flutter-localizations
This file contains hidden or 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 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:your_app_package/services/localization/app_translations.dart'; | |
| class SpecificTranslationsDelegate extends LocalizationsDelegate<AppTranslations> { | |
| final Locale overriddenLocale; | |
| const SpecificTranslationsDelegate(this.overriddenLocale); | |
| @override | |
| bool isSupported(Locale locale) => overriddenLocale != null; | |
| @override | |
| Future<AppTranslations> load(Locale locale) => AppTranslations.load(overriddenLocale); | |
| @override | |
| bool shouldReload(LocalizationsDelegate<AppTranslations> old) => true; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment