feat(locale): 实现 App 启动时语言和时区自动设置
- 新增系统语言/时区读取工具函数 - SessionStore 扩展支持时区存储 - 启动流程自动检测并保存系统语言/时区 - 注册时传递语言/时区到后端 - 登录后从服务器同步语言/时区
This commit is contained in:
@@ -50,8 +50,15 @@ class AuthBloc extends ChangeNotifier {
|
||||
Future<void> loginWithOtp({
|
||||
required String email,
|
||||
required String otp,
|
||||
String? language,
|
||||
String? timezone,
|
||||
}) async {
|
||||
final user = await _repository.loginWithEmailOtp(email: email, otp: otp);
|
||||
final user = await _repository.loginWithEmailOtp(
|
||||
email: email,
|
||||
otp: otp,
|
||||
language: language,
|
||||
timezone: timezone,
|
||||
);
|
||||
_logger.info(message: 'User logged in', extra: {'user_id': user.id});
|
||||
_state = AuthState(status: AuthStatus.authenticated, user: user);
|
||||
notifyListeners();
|
||||
|
||||
Reference in New Issue
Block a user