fix: 修复手机连不上服务器时启动页无限转圈(B-58)

- 启动页先读本地凭证:无凭证(首次打开)直接进登录页,不再先等 SDK 初始化
- SDK init/login 加 20s 超时;init 用共享 Future 防止超时后重复触发 initSDK
- 登录页对 IM 登录超时给出明确提示(确认手机连着公司内网 WiFi)
- 修复 flutter create 模板遗留的 widget_test(引用不存在的 MyApp),改为登录页渲染冒烟测试
- 版本号 1.0.1+2
This commit is contained in:
KIMI
2026-08-15 14:54:52 +08:00
parent d481e1bc2f
commit 3b5c76cac4
5 changed files with 45 additions and 40 deletions
+5 -24
View File
@@ -1,30 +1,11 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:changlian/screens/login_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:changlian/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
testWidgets('登录页能正常渲染', (tester) async {
await tester.pumpWidget(const MaterialApp(home: LoginScreen()));
expect(find.text('畅联'), findsOneWidget);
expect(find.text('登录'), findsOneWidget);
});
}