feat(flutter): 强化开屏品牌标识展示
This commit is contained in:
1 parent
fcf30ff39c
commit
c147645824
2 files changed
+21
-2
No files matched your search
@@ -8,8 +8,8 @@ import 'package:flutter/services.dart';
|
||||
import '../../core/theme/app_colors.dart';
|
||||
|
||||
const Color _splashBackground = Color(0xFF100C0A);
|
||||
const Color _markGlow = Color(0x33FF7A1A);
|
||||
const double _markSize = 96;
|
||||
const Color _markGlow = Color(0x40FF7A1A);
|
||||
const double _markSize = 112;
|
||||
const double _markRadius = 24;
|
||||
const double _logoGlowSize = 144;
|
||||
const double _logoGlowBlur = 40;
|
||||
@@ -130,6 +130,7 @@ class _SplashPageState extends State<SplashPage>
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
ImageFiltered(
|
||||
key: const Key('splash-logo-glow'),
|
||||
imageFilter: ImageFilter.blur(
|
||||
sigmaX: _logoGlowBlur,
|
||||
sigmaY: _logoGlowBlur,
|
||||
@@ -149,6 +150,7 @@ class _SplashPageState extends State<SplashPage>
|
||||
borderRadius: BorderRadius.circular(_markRadius),
|
||||
child: Image.asset(
|
||||
_markAsset,
|
||||
key: const Key('splash-logo-mark'),
|
||||
width: _markSize,
|
||||
height: _markSize,
|
||||
filterQuality: FilterQuality.medium,
|
||||
|
||||
@@ -53,6 +53,23 @@ void main() {
|
||||
expect(find.byKey(const Key('splash-brand')), findsOneWidget);
|
||||
expect(find.byKey(const Key('splash-tagline')), findsOneWidget);
|
||||
expect(find.byKey(const Key('splash-loading')), findsOneWidget);
|
||||
final mark = tester.widget<Image>(
|
||||
find.byKey(const Key('splash-logo-mark')),
|
||||
);
|
||||
expect((mark.image as AssetImage).assetName, 'assets/icon/splash_mark.png');
|
||||
expect(mark.width, 112);
|
||||
expect(mark.height, 112);
|
||||
final glow = tester.widget<Container>(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('splash-logo-glow')),
|
||||
matching: find.byType(Container),
|
||||
),
|
||||
);
|
||||
final glowGradient = (glow.decoration as BoxDecoration).gradient;
|
||||
expect(
|
||||
(glowGradient as RadialGradient).colors.first,
|
||||
const Color(0x40FF7A1A),
|
||||
);
|
||||
expect(
|
||||
tester.widget<ColoredBox>(find.byKey(const Key('splash-screen'))).color,
|
||||
const Color(0xFF100C0A),
|
||||
|
||||
Reference in new issue
Block a user