Files
VibeCoding/webrtc_controller_flutter/lib/features/auth/domain/auth_state.dart
TongTongStudio 79cffcb041 feat(auth): 添加登录/注册页面及令牌恢复流程
- 新增 SplashPage(启动页)和 LoginPage(登录页),支持路由跳转
- 扩展 AuthState,增加 submitting/alert/busy 状态及消费机制
- AuthController 增加 checkLoginState/register/showAlert 等方法
- 删除旧模型文件(binding_item, token_response, verify_response)
- 删除旧版 LoginPage,迁移至 features/auth 目录
- 更新本地化字符串,增加注册相关文案
- 调整默认 API 地址为本地开发环境
2026-08-03 16:47:08 +08:00

25 lines
662 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:freezed_annotation/freezed_annotation.dart';
part 'auth_state.freezed.dart';
/// 登录状态。
///
/// [alert] 为一次性提示登录失效、注册成功等UI 展示后须调用
/// `AuthController.consumeAlert()` 消费,避免重建时重复弹出。
@freezed
class AuthState with _$AuthState {
const AuthState._();
const factory AuthState({
@Default(false) bool loggedIn,
@Default(false) bool restoring,
@Default(false) bool submitting,
String? username,
String? error,
String? alert,
}) = _AuthState;
/// 是否应禁用输入与提交按钮。
bool get busy => submitting || restoring;
}