feat: 整体常用控件封装,常用工具类。首页数据对接

This commit is contained in:
chengsiwen committed 2026-06-27 14:15:25 +08:00
1 parent d90d023e85
commit fbcd33ea2b
50 files changed
+4558 -264

No files matched your search

+23 -21
View File
@@ -1,31 +1,33 @@
// 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:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:skywood/main.dart';
import 'package:skywood/main/main_root.dart';
import 'package:skywood/pages/home/home_page.dart';
import 'package:skywood/utils/tools/help_img.dart';
import 'helpers/app_test_harness.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
testWidgets('ComApp renders the configured root tabs', (
WidgetTester tester,
) async {
await prepareAppTestHarness();
tester.view.physicalSize = const Size(375, 812);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
await tester.pumpWidget(const ComApp(home: MainRoot()));
await tester.pump(const Duration(seconds: 1));
// 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);
expect(find.byType(HomePage, skipOffstage: false), findsOneWidget);
expect(
find.image(const AssetImage(ConstImg.tabHomeSelected)),
findsOneWidget,
);
expect(
find.image(const AssetImage(ConstImg.tabSearchUnselect)),
findsOneWidget,
);
});
}