根本原因:Dio interceptor 的 onError/onRequest 签名是 void, 标 async 后变成 Future<void> 但没人 await,内部异常全部变成 Unhandled Exception 崩溃。 修复: - RetryInterceptor: onError 改为同步调度,retry 逻辑移到独立 _retry() 方法并用 try/catch 包裹全部路径 - DedupInterceptor: 防止 Completer 重复 complete,retry 请求 跳过去重避免与原始请求冲突 - TokenInterceptor: onRequest 和 onError 的 async lambda 全部 包裹 try/catch,异常时 fallback 到 handler.next() - main.dart: 三层全局错误兜底 — 1) FlutterError.onError 捕获框架错误 2) PlatformDispatcher.onError 捕获平台通道错误 3) runZonedGuarded 捕获所有漏网的异步异常 - receiveTimeout/sendTimeout 不再触发重试(服务器已收到请求) - 超时调整: connect 10s, send 30s, receive 30s - 仪表盘卡片 IntrinsicHeight 等高对齐 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| audio | ||
| config | ||
| errors | ||
| network | ||
| router | ||
| services | ||
| tenant | ||
| theme | ||
| utils | ||
| widgets | ||