feat(flutter): 优化浅色开屏与原生过渡
This commit is contained in:
1 parent
576f2b95f4
commit
398dc3f8b4
3 files changed
+20
-12
No files matched your search
@@ -2,6 +2,6 @@
|
||||
<!-- Author: fruit.com.cn -->
|
||||
|
||||
<resources>
|
||||
<color name="splash_background">#FF100C0A</color>
|
||||
<color name="splash_background">#FFF8F0</color>
|
||||
<color name="ic_launcher_background">#FFF1E5</color>
|
||||
</resources>
|
||||
</resources>
|
||||
@@ -7,8 +7,7 @@ import 'package:flutter/services.dart';
|
||||
|
||||
import '../../core/theme/app_colors.dart';
|
||||
|
||||
const Color _splashBackground = Color(0xFF100C0A);
|
||||
const Color _markGlow = Color(0x40FF7A1A);
|
||||
const Color _markGlow = Color(0x33FF7A1A);
|
||||
const double _markSize = 112;
|
||||
const double _markRadius = 24;
|
||||
const double _logoGlowSize = 144;
|
||||
@@ -18,7 +17,7 @@ const double _loaderStroke = 2;
|
||||
const String _markAsset = 'assets/icon/splash_mark.png';
|
||||
const Duration _introDuration = Duration(milliseconds: 1200);
|
||||
|
||||
/// 品牌开屏:深暖底上依次呈现水果标记、FruitShorts 与中文标语。
|
||||
/// 品牌开屏:浅暖底上依次呈现水果标记、FruitShorts 与中文标语。
|
||||
class SplashPage extends StatefulWidget {
|
||||
const SplashPage({super.key});
|
||||
|
||||
@@ -75,10 +74,10 @@ class _SplashPageState extends State<SplashPage>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: SystemUiOverlayStyle.light,
|
||||
value: SystemUiOverlayStyle.dark,
|
||||
child: ColoredBox(
|
||||
key: const Key('splash-screen'),
|
||||
color: _splashBackground,
|
||||
color: AppColors.ink,
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
@@ -178,7 +177,7 @@ class _SplashPageState extends State<SplashPage>
|
||||
'FruitShorts',
|
||||
key: Key('splash-brand'),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
color: AppColors.onSurface,
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontFamily: 'Outfit',
|
||||
@@ -202,7 +201,7 @@ class _SplashPageState extends State<SplashPage>
|
||||
'水果短剧',
|
||||
key: Key('splash-tagline'),
|
||||
style: TextStyle(
|
||||
color: Colors.white70,
|
||||
color: AppColors.muted,
|
||||
fontSize: 13,
|
||||
letterSpacing: 4,
|
||||
),
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:fruitshorts/core/data/models/drama.dart';
|
||||
import 'package:fruitshorts/core/data/models/home_feed.dart';
|
||||
import 'package:fruitshorts/core/data/repositories/catalog_repository.dart';
|
||||
import 'package:fruitshorts/core/data/services/catalog_controller.dart';
|
||||
import 'package:fruitshorts/core/theme/app_colors.dart';
|
||||
import 'package:fruitshorts/l10n/app_localizations.dart';
|
||||
import 'package:fruitshorts/pages/home/home_view.dart';
|
||||
import 'package:fruitshorts/pages/splash/splash_page.dart';
|
||||
@@ -68,16 +69,24 @@ void main() {
|
||||
final glowGradient = (glow.decoration as BoxDecoration).gradient;
|
||||
expect(
|
||||
(glowGradient as RadialGradient).colors.first,
|
||||
const Color(0x40FF7A1A),
|
||||
const Color(0x33FF7A1A),
|
||||
);
|
||||
expect(
|
||||
tester.widget<ColoredBox>(find.byKey(const Key('splash-screen'))).color,
|
||||
const Color(0xFF100C0A),
|
||||
AppColors.ink,
|
||||
);
|
||||
expect(
|
||||
tester.widget<Text>(find.byKey(const Key('splash-brand'))).style?.color,
|
||||
AppColors.onSurface,
|
||||
);
|
||||
expect(
|
||||
tester.widget<Text>(find.byKey(const Key('splash-tagline'))).style?.color,
|
||||
AppColors.muted,
|
||||
);
|
||||
final overlay = tester.widget<AnnotatedRegion<SystemUiOverlayStyle>>(
|
||||
find.byType(AnnotatedRegion<SystemUiOverlayStyle>).first,
|
||||
);
|
||||
expect(overlay.value.statusBarIconBrightness, Brightness.light);
|
||||
expect(overlay.value.statusBarIconBrightness, Brightness.dark);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 1200));
|
||||
|
||||
|
||||
Reference in new issue
Block a user