登录流程已全部重构
This commit is contained in:
20
lib/stores/setting_store.dart
Normal file
20
lib/stores/setting_store.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class SettingStore extends ChangeNotifier {
|
||||
late Locale _locale;
|
||||
|
||||
Locale get locale => _locale;
|
||||
|
||||
SettingStore() {
|
||||
final systemLocale = PlatformDispatcher.instance.locale;
|
||||
_locale = systemLocale;
|
||||
}
|
||||
|
||||
/// 设置语言
|
||||
void setLocale(Locale locale) {
|
||||
_locale = locale;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user