-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
localization.dart
32 lines (25 loc) · 912 Bytes
/
localization.dart
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
// Copyright 2018 The Flutter Architecture Sample Authors. All rights reserved.
// Use of this source code is governed by the MIT license that can be found
// in the LICENSE file.
import 'dart:async';
import 'package:flutter/material.dart';
class FlutterBlocLocalizations {
static FlutterBlocLocalizations of(BuildContext context) {
return Localizations.of<FlutterBlocLocalizations>(
context,
FlutterBlocLocalizations,
);
}
String get appTitle => "Bloc Library Example";
}
class FlutterBlocLocalizationsDelegate
extends LocalizationsDelegate<FlutterBlocLocalizations> {
@override
Future<FlutterBlocLocalizations> load(Locale locale) =>
Future(() => FlutterBlocLocalizations());
@override
bool shouldReload(FlutterBlocLocalizationsDelegate old) => false;
@override
bool isSupported(Locale locale) =>
locale.languageCode.toLowerCase().contains("en");
}