feat: 保留系统开屏并更新品牌素材
No files matched your search
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 42 KiB |
@@ -1318,3 +1318,4 @@ $ flutter test
|
||||
- Launcher/Android 12 启动背景统一纯黑,自适应图标背景改为品牌橙。
|
||||
- Android/iOS 图标与启动资源已重新生成;应用内开屏固定 splash_logo,宽 200 等比居中。
|
||||
- `flutter analyze`:No issues found。
|
||||
- 移除 Flutter 内 `_startupSplash` 与 `startup-splash`,只保留系统原生开屏;最新斜体字标素材已重新生成。
|
||||
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 454 B After Width: | Height: | Size: 412 B |
|
Before Width: | Height: | Size: 999 B After Width: | Height: | Size: 907 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 718 B After Width: | Height: | Size: 593 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 999 B After Width: | Height: | Size: 907 B |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
@@ -43,8 +43,6 @@ class HomePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
||||
static const _splashAsset = 'assets/icon/splash_logo.png';
|
||||
|
||||
bool _resumeRetryInFlight = false;
|
||||
HomeFeedController? _homeFeed;
|
||||
bool _recommendSeeded = false;
|
||||
@@ -111,7 +109,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
||||
AppLocalizations l10n,
|
||||
) {
|
||||
if (catalog.loading) {
|
||||
return catalog.settled ? _retryLoading() : _startupSplash();
|
||||
return _retryLoading();
|
||||
}
|
||||
if (catalog.error != null) {
|
||||
return Scaffold(
|
||||
@@ -158,23 +156,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
||||
}
|
||||
}
|
||||
|
||||
Widget _startupSplash() {
|
||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: SystemUiOverlayStyle.light,
|
||||
child: ColoredBox(
|
||||
color: AppColors.mediaBlack,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
_splashAsset,
|
||||
key: const Key('startup-splash'),
|
||||
width: 200,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _retryLoading() {
|
||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: SystemUiOverlayStyle.light,
|
||||
|
||||
@@ -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);
|
||||
|
||||
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();
|
||||
|
||||