21 lines
379 B
Dart
21 lines
379 B
Dart
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();
|
|
}
|
|
}
|