Add re-export of l10n

This commit is contained in:
shilangyu 2021-02-27 14:39:58 +01:00
parent 22b76b0b2b
commit 28013a8a45
3 changed files with 11 additions and 1 deletions

1
lib/l10n/l10n.dart Normal file
View File

@ -0,0 +1 @@
export 'package:flutter_gen/gen_l10n/l10n.dart';

View File

@ -2,11 +2,11 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:provider/provider.dart';
import 'hooks/stores.dart';
import 'l10n/l10n.dart';
import 'pages/communities_tab.dart';
import 'pages/create_post.dart';
import 'pages/home_tab.dart';

View File

@ -31,6 +31,15 @@ class ConfigStore extends ChangeNotifier {
save();
}
Locale _locale;
@JsonKey(defaultValue: Locale('en'))
Locale get locale => _locale;
set locale(Locale locale) {
_locale = locale;
notifyListeners();
save();
}
static Future<ConfigStore> load() async {
final prefs = await _prefs;