fix(auth): 登录异常改为居中吐司
This commit is contained in:
1 parent
11e37a92b5
commit
d076c57283
16 files changed
+341
-175
No files matched your search
@@ -0,0 +1,29 @@
|
||||
# 登录异常居中吐司
|
||||
|
||||
## 目标
|
||||
|
||||
- 将上一版认证异常 AlertDialog 替换为无交互的屏幕居中吐司。
|
||||
- 吐司淡入展示约 2 秒后自动淡出,不遮罩、不拦截手势。
|
||||
- 同一时刻只存在一个吐司,新消息替换旧消息。
|
||||
|
||||
## 实施步骤
|
||||
|
||||
1. 删除 `centered_error_dialog.dart`,新增 `centered_toast.dart`。
|
||||
2. 认证页和手机号弹窗异常路径改用 `showCenteredToast`,保留 busy 复位和成功 SnackBar。
|
||||
3. 清理不再使用的认证错误标题与确认按钮 l10n 键,重新生成 AppLocalizations。
|
||||
4. 更新认证测试为吐司断言,并补单例替换、自动消失测试。
|
||||
5. 执行 `dart analyze lib test` 与 `flutter test --no-pub`,回填 PROGRESS 后提交合并。
|
||||
|
||||
## 风险 / 待确认
|
||||
|
||||
- 吐司使用 root Overlay,认证路由退出时仍会按自身计时器自动清理。
|
||||
- 测试必须 pump 超过展示和淡出时长,确保不遗留 Timer 或 OverlayEntry。
|
||||
|
||||
## 执行结果
|
||||
|
||||
- 已删除 AlertDialog 组件,新增 OverlayEntry 居中吐司。
|
||||
- 邮箱和手机号异常改用吐司;busy 复位、成功 SnackBar 和本地内联校验保持不变。
|
||||
- 已清理三个不再使用的 l10n 键并重新生成 AppLocalizations。
|
||||
- 覆盖单例替换、点击穿透、自动消失、接口异常和本地校验不弹吐司。
|
||||
- `dart analyze lib test` 零告警,`flutter test --no-pub` 573 项全过。
|
||||
- 未启停服务,未操作真机。
|
||||
@@ -233,3 +233,36 @@ $ flutter test --no-pub
|
||||
解读:登录异常、注册标题、未知异常回退、本地校验不弹窗、遮罩/按钮关闭和手机号两条
|
||||
异常路径均通过;全量静态分析零告警,570 项测试全过。`pubspec.lock` 已还原,
|
||||
未启停服务,未操作真机。
|
||||
|
||||
## 2026-10-22 登录异常调整为中心吐司
|
||||
|
||||
- 已从 `develop`(`11e37a9`)创建 `feature/login-error-center-toast`。
|
||||
- 删除 AlertDialog 组件,新增 OverlayEntry 居中吐司:淡入淡出、约 2 秒消失、不拦截手势。
|
||||
- 吐司保持全局单例,新消息替换旧消息;邮箱与手机号异常路径均已切换。
|
||||
- 本地表单校验继续内联,手机号验证码发送成功 SnackBar 保持不变。
|
||||
- 清理 `authLoginFailed` / `authRegisterFailed` / `authErrorConfirm` 并重新生成 l10n。
|
||||
|
||||
执行命令与原始输出:
|
||||
|
||||
```text
|
||||
$ flutter gen-l10n
|
||||
Because l10n.yaml exists, the options defined there will be used instead.
|
||||
To use the command line arguments, delete the l10n.yaml file in the Flutter project.
|
||||
|
||||
$ flutter test --no-pub test/core/centered_toast_test.dart
|
||||
00:00 +3: All tests passed!
|
||||
|
||||
$ flutter test --no-pub test/auth/auth_page_test.dart test/auth/phone_auth_sheet_test.dart
|
||||
00:02 +20: All tests passed!
|
||||
|
||||
$ dart analyze lib test
|
||||
Analyzing lib, test...
|
||||
No issues found!
|
||||
|
||||
$ flutter test --no-pub
|
||||
01:00 +573: All tests passed!
|
||||
```
|
||||
|
||||
解读:吐司单例替换、点击穿透和自动消失通过;认证异常与本地校验路径通过;
|
||||
全量静态分析零告警,573 项测试全过。`pubspec.lock` 已还原,未启停服务,
|
||||
未操作真机。
|
||||
Reference in new issue
Block a user