feat: 保留系统开屏并更新品牌素材
This commit is contained in:
1 parent
41bd4683c3
commit
345cc2ad28
56 files changed
+10
-53
No files matched your search
@@ -2,7 +2,6 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -39,12 +38,11 @@ void main() {
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
debugDefaultTargetPlatformOverride = null;
|
||||
AppConfig.clearRuntimeBaseUrl();
|
||||
AppConfig.ready = Future<void>.value();
|
||||
});
|
||||
|
||||
testWidgets('should_show_platform_startup_image_before_catalog_settles', (
|
||||
testWidgets('should_show_loading_without_flutter_splash_before_settles', (
|
||||
tester,
|
||||
) async {
|
||||
final controller = CatalogController(_EmptyCatalogRepository())
|
||||
@@ -52,33 +50,10 @@ void main() {
|
||||
..settled = false;
|
||||
addTearDown(controller.dispose);
|
||||
|
||||
for (final platform in [TargetPlatform.android, TargetPlatform.iOS]) {
|
||||
debugDefaultTargetPlatformOverride = platform;
|
||||
await _pumpHomePage(tester, controller);
|
||||
await _pumpHomePage(tester, controller);
|
||||
|
||||
final image = tester.widget<Image>(
|
||||
find.byKey(const Key('startup-splash')),
|
||||
);
|
||||
final expectedAsset = platform == TargetPlatform.android
|
||||
? 'assets/icon/splash_logo_android12.png'
|
||||
: 'assets/icon/splash_logo.png';
|
||||
final expectedSize = platform == TargetPlatform.android ? 288.0 : 384.0;
|
||||
|
||||
expect(
|
||||
image.image,
|
||||
isA<AssetImage>().having(
|
||||
(asset) => asset.assetName,
|
||||
'assetName',
|
||||
expectedAsset,
|
||||
),
|
||||
);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('startup-splash'))),
|
||||
Size.square(expectedSize),
|
||||
);
|
||||
expect(find.byType(CircularProgressIndicator), findsNothing);
|
||||
}
|
||||
debugDefaultTargetPlatformOverride = null;
|
||||
expect(find.byType(CircularProgressIndicator), findsOneWidget);
|
||||
expect(find.byKey(const Key('startup-splash')), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('should_show_spinner_when_retry_loads_after_catalog_settled', (
|
||||
@@ -95,7 +70,7 @@ void main() {
|
||||
expect(find.byKey(const Key('startup-splash')), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('should_enter_home_and_remove_startup_image_when_data_is_ready', (
|
||||
testWidgets('should_enter_home_after_loading_when_data_is_ready', (
|
||||
tester,
|
||||
) async {
|
||||
AppConfig.ready = Future<void>.value();
|
||||
@@ -116,8 +91,8 @@ void main() {
|
||||
);
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byKey(const Key('startup-splash')), findsOneWidget);
|
||||
expect(find.byType(CircularProgressIndicator), findsNothing);
|
||||
expect(find.byKey(const Key('startup-splash')), findsNothing);
|
||||
expect(find.byType(CircularProgressIndicator), findsOneWidget);
|
||||
|
||||
catalog.complete(_feed);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
Reference in new issue
Block a user