diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_001.png b/frontend/mobile-app/assets/images/splash_frames/frame_001.png new file mode 100644 index 00000000..016c7c8f Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_001.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_002.png b/frontend/mobile-app/assets/images/splash_frames/frame_002.png new file mode 100644 index 00000000..df82ce23 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_002.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_003.png b/frontend/mobile-app/assets/images/splash_frames/frame_003.png new file mode 100644 index 00000000..6acb972e Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_003.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_004.png b/frontend/mobile-app/assets/images/splash_frames/frame_004.png new file mode 100644 index 00000000..8b3e7988 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_004.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_005.png b/frontend/mobile-app/assets/images/splash_frames/frame_005.png new file mode 100644 index 00000000..d914ae80 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_005.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_006.png b/frontend/mobile-app/assets/images/splash_frames/frame_006.png new file mode 100644 index 00000000..c754c2ac Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_006.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_007.png b/frontend/mobile-app/assets/images/splash_frames/frame_007.png new file mode 100644 index 00000000..12e81fb4 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_007.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_008.png b/frontend/mobile-app/assets/images/splash_frames/frame_008.png new file mode 100644 index 00000000..c8200f39 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_008.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_009.png b/frontend/mobile-app/assets/images/splash_frames/frame_009.png new file mode 100644 index 00000000..5a825b0c Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_009.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_010.png b/frontend/mobile-app/assets/images/splash_frames/frame_010.png new file mode 100644 index 00000000..6a42299c Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_010.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_011.png b/frontend/mobile-app/assets/images/splash_frames/frame_011.png new file mode 100644 index 00000000..50279488 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_011.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_012.png b/frontend/mobile-app/assets/images/splash_frames/frame_012.png new file mode 100644 index 00000000..2945c35b Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_012.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_013.png b/frontend/mobile-app/assets/images/splash_frames/frame_013.png new file mode 100644 index 00000000..57cfc1a6 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_013.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_014.png b/frontend/mobile-app/assets/images/splash_frames/frame_014.png new file mode 100644 index 00000000..c025b454 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_014.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_015.png b/frontend/mobile-app/assets/images/splash_frames/frame_015.png new file mode 100644 index 00000000..6093ffa3 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_015.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_016.png b/frontend/mobile-app/assets/images/splash_frames/frame_016.png new file mode 100644 index 00000000..3858f67d Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_016.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_017.png b/frontend/mobile-app/assets/images/splash_frames/frame_017.png new file mode 100644 index 00000000..a218ba8d Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_017.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_018.png b/frontend/mobile-app/assets/images/splash_frames/frame_018.png new file mode 100644 index 00000000..c047e7d3 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_018.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_019.png b/frontend/mobile-app/assets/images/splash_frames/frame_019.png new file mode 100644 index 00000000..8ce7733c Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_019.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_020.png b/frontend/mobile-app/assets/images/splash_frames/frame_020.png new file mode 100644 index 00000000..1aa40615 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_020.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_021.png b/frontend/mobile-app/assets/images/splash_frames/frame_021.png new file mode 100644 index 00000000..e51e1753 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_021.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_022.png b/frontend/mobile-app/assets/images/splash_frames/frame_022.png new file mode 100644 index 00000000..d3d1bf86 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_022.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_023.png b/frontend/mobile-app/assets/images/splash_frames/frame_023.png new file mode 100644 index 00000000..74d77fed Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_023.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_024.png b/frontend/mobile-app/assets/images/splash_frames/frame_024.png new file mode 100644 index 00000000..ac745f11 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_024.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_025.png b/frontend/mobile-app/assets/images/splash_frames/frame_025.png new file mode 100644 index 00000000..e449f8ec Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_025.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_026.png b/frontend/mobile-app/assets/images/splash_frames/frame_026.png new file mode 100644 index 00000000..728775cf Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_026.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_027.png b/frontend/mobile-app/assets/images/splash_frames/frame_027.png new file mode 100644 index 00000000..39f22702 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_027.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_028.png b/frontend/mobile-app/assets/images/splash_frames/frame_028.png new file mode 100644 index 00000000..979526bb Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_028.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_029.png b/frontend/mobile-app/assets/images/splash_frames/frame_029.png new file mode 100644 index 00000000..9e0ebaf7 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_029.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_030.png b/frontend/mobile-app/assets/images/splash_frames/frame_030.png new file mode 100644 index 00000000..74558e1d Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_030.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_031.png b/frontend/mobile-app/assets/images/splash_frames/frame_031.png new file mode 100644 index 00000000..ca28047a Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_031.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_032.png b/frontend/mobile-app/assets/images/splash_frames/frame_032.png new file mode 100644 index 00000000..7a5f3ed7 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_032.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_033.png b/frontend/mobile-app/assets/images/splash_frames/frame_033.png new file mode 100644 index 00000000..d16d239e Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_033.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_034.png b/frontend/mobile-app/assets/images/splash_frames/frame_034.png new file mode 100644 index 00000000..5aacef15 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_034.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_035.png b/frontend/mobile-app/assets/images/splash_frames/frame_035.png new file mode 100644 index 00000000..f62ab206 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_035.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_036.png b/frontend/mobile-app/assets/images/splash_frames/frame_036.png new file mode 100644 index 00000000..ec8ab2c9 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_036.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_037.png b/frontend/mobile-app/assets/images/splash_frames/frame_037.png new file mode 100644 index 00000000..5c529b50 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_037.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_038.png b/frontend/mobile-app/assets/images/splash_frames/frame_038.png new file mode 100644 index 00000000..277c0cf2 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_038.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_039.png b/frontend/mobile-app/assets/images/splash_frames/frame_039.png new file mode 100644 index 00000000..04f910a9 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_039.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_040.png b/frontend/mobile-app/assets/images/splash_frames/frame_040.png new file mode 100644 index 00000000..bdd06aa7 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_040.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_041.png b/frontend/mobile-app/assets/images/splash_frames/frame_041.png new file mode 100644 index 00000000..368e5e93 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_041.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_042.png b/frontend/mobile-app/assets/images/splash_frames/frame_042.png new file mode 100644 index 00000000..79ee3398 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_042.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_043.png b/frontend/mobile-app/assets/images/splash_frames/frame_043.png new file mode 100644 index 00000000..87203b1b Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_043.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_044.png b/frontend/mobile-app/assets/images/splash_frames/frame_044.png new file mode 100644 index 00000000..ca16f9d6 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_044.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_045.png b/frontend/mobile-app/assets/images/splash_frames/frame_045.png new file mode 100644 index 00000000..621e09a9 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_045.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_046.png b/frontend/mobile-app/assets/images/splash_frames/frame_046.png new file mode 100644 index 00000000..f9faa4dc Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_046.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_047.png b/frontend/mobile-app/assets/images/splash_frames/frame_047.png new file mode 100644 index 00000000..06c83ab1 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_047.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_048.png b/frontend/mobile-app/assets/images/splash_frames/frame_048.png new file mode 100644 index 00000000..04c73b6a Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_048.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_049.png b/frontend/mobile-app/assets/images/splash_frames/frame_049.png new file mode 100644 index 00000000..eae5b47f Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_049.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_050.png b/frontend/mobile-app/assets/images/splash_frames/frame_050.png new file mode 100644 index 00000000..148d4b00 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_050.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_051.png b/frontend/mobile-app/assets/images/splash_frames/frame_051.png new file mode 100644 index 00000000..50ca03d2 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_051.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_052.png b/frontend/mobile-app/assets/images/splash_frames/frame_052.png new file mode 100644 index 00000000..5a8c51f6 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_052.png differ diff --git a/frontend/mobile-app/assets/images/splash_frames/frame_053.png b/frontend/mobile-app/assets/images/splash_frames/frame_053.png new file mode 100644 index 00000000..113a9265 Binary files /dev/null and b/frontend/mobile-app/assets/images/splash_frames/frame_053.png differ diff --git a/frontend/mobile-app/lib/features/auth/presentation/pages/splash_page.dart b/frontend/mobile-app/lib/features/auth/presentation/pages/splash_page.dart index ffee27ac..35fd4dc0 100644 --- a/frontend/mobile-app/lib/features/auth/presentation/pages/splash_page.dart +++ b/frontend/mobile-app/lib/features/auth/presentation/pages/splash_page.dart @@ -16,8 +16,7 @@ class SplashPage extends ConsumerStatefulWidget { ConsumerState createState() => _SplashPageState(); } -class _SplashPageState extends ConsumerState - with SingleTickerProviderStateMixin { +class _SplashPageState extends ConsumerState { /// 视频播放控制器 VideoPlayerController? _videoController; @@ -33,17 +32,17 @@ class _SplashPageState extends ConsumerState /// 视频加载是否失败(使用 fallback 动画) bool _videoFailed = false; - /// Fallback 动画控制器 - AnimationController? _fallbackAnimationController; + /// 帧动画总帧数 + static const int _totalFrames = 53; - /// Logo 缩放动画 - Animation? _logoScaleAnimation; + /// 帧动画帧率 (fps) + static const int _frameRate = 15; - /// Logo 透明度动画 - Animation? _logoOpacityAnimation; + /// 当前显示的帧索引 + int _currentFrameIndex = 0; - /// 文字透明度动画 - Animation? _textOpacityAnimation; + /// 帧动画是否正在播放 + bool _isFrameAnimationPlaying = false; @override void initState() { @@ -55,7 +54,6 @@ class _SplashPageState extends ConsumerState void dispose() { _videoController?.removeListener(_onVideoStateChanged); _videoController?.dispose(); - _fallbackAnimationController?.dispose(); super.dispose(); } @@ -130,77 +128,18 @@ class _SplashPageState extends ConsumerState } } - /// 启动 fallback 动画(视频加载失败时使用) + /// 启动 fallback 帧动画(视频加载失败时使用) void _startFallbackAnimation() { - debugPrint('[SplashPage] 启动 fallback 动画'); + debugPrint('[SplashPage] 启动 fallback 帧动画,共 $_totalFrames 帧'); setState(() { _videoFailed = true; + _isFrameAnimationPlaying = true; + _currentFrameIndex = 0; }); - // 创建动画控制器,总时长 3 秒 - _fallbackAnimationController = AnimationController( - vsync: this, - duration: const Duration(milliseconds: 3000), - ); - - // Logo 缩放动画:0.5 -> 1.0 -> 1.05 -> 1.0(弹性效果) - _logoScaleAnimation = TweenSequence([ - TweenSequenceItem( - tween: Tween(begin: 0.5, end: 1.05) - .chain(CurveTween(curve: Curves.easeOutBack)), - weight: 40, - ), - TweenSequenceItem( - tween: Tween(begin: 1.05, end: 1.0) - .chain(CurveTween(curve: Curves.easeInOut)), - weight: 10, - ), - TweenSequenceItem( - tween: ConstantTween(1.0), - weight: 50, - ), - ]).animate(_fallbackAnimationController!); - - // Logo 透明度动画:0 -> 1 - _logoOpacityAnimation = TweenSequence([ - TweenSequenceItem( - tween: Tween(begin: 0.0, end: 1.0) - .chain(CurveTween(curve: Curves.easeOut)), - weight: 30, - ), - TweenSequenceItem( - tween: ConstantTween(1.0), - weight: 70, - ), - ]).animate(_fallbackAnimationController!); - - // 文字透明度动画:延迟出现 - _textOpacityAnimation = TweenSequence([ - TweenSequenceItem( - tween: ConstantTween(0.0), - weight: 30, - ), - TweenSequenceItem( - tween: Tween(begin: 0.0, end: 1.0) - .chain(CurveTween(curve: Curves.easeOut)), - weight: 20, - ), - TweenSequenceItem( - tween: ConstantTween(1.0), - weight: 50, - ), - ]).animate(_fallbackAnimationController!); - - // 动画完成后跳转 - _fallbackAnimationController!.addStatusListener((status) { - if (status == AnimationStatus.completed) { - _navigateToNextPage(); - } - }); - - // 开始动画 - _fallbackAnimationController!.forward(); + // 启动帧动画播放 + _playFrameAnimation(); // 1秒后显示跳过按钮 Future.delayed(const Duration(seconds: 1), () { @@ -212,9 +151,29 @@ class _SplashPageState extends ConsumerState }); } - /// 跳过 fallback 动画 + /// 播放帧动画 + Future _playFrameAnimation() async { + final frameDuration = Duration(milliseconds: 1000 ~/ _frameRate); + + while (_isFrameAnimationPlaying && _currentFrameIndex < _totalFrames && mounted) { + await Future.delayed(frameDuration); + + if (!mounted || !_isFrameAnimationPlaying) break; + + setState(() { + _currentFrameIndex++; + }); + } + + // 动画播放完成 + if (_currentFrameIndex >= _totalFrames && mounted && _isFrameAnimationPlaying) { + _navigateToNextPage(); + } + } + + /// 跳过 fallback 帧动画 void _skipFallbackAnimation() { - _fallbackAnimationController?.stop(); + _isFrameAnimationPlaying = false; _navigateToNextPage(); } @@ -372,44 +331,43 @@ class _SplashPageState extends ConsumerState ); } - /// 构建 fallback 动画视图(视频加载失败时使用) + /// 构建 fallback 帧动画视图(视频加载失败时使用) Widget _buildFallbackAnimationView() { - return AnimatedBuilder( - animation: _fallbackAnimationController!, - builder: (context, child) { - return Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color(0xFFFFF5E6), - Color(0xFFFFE4B5), - ], - ), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // Logo 带缩放和透明度动画 - Opacity( - opacity: _logoOpacityAnimation?.value ?? 1.0, - child: Transform.scale( - scale: _logoScaleAnimation?.value ?? 1.0, - child: Image.asset( - 'assets/images/logo/app_icon.png', - width: 128, - height: 128, - ), - ), + // 帧文件名格式: frame_001.png, frame_002.png, ... frame_053.png + final frameNumber = (_currentFrameIndex + 1).toString().padLeft(3, '0'); + final framePath = 'assets/images/splash_frames/frame_$frameNumber.png'; + + return SizedBox.expand( + child: Image.asset( + framePath, + fit: BoxFit.cover, + gaplessPlayback: true, // 关键:防止帧切换时闪烁 + errorBuilder: (context, error, stackTrace) { + // 帧加载失败时显示静态 fallback + debugPrint('[SplashPage] 帧加载失败: $framePath, 错误: $error'); + return Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFFFFF5E6), + Color(0xFFFFE4B5), + ], ), - const SizedBox(height: 24), - // 文字带透明度动画 - Opacity( - opacity: _textOpacityAnimation?.value ?? 1.0, - child: const Text( + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/logo/app_icon.png', + width: 128, + height: 128, + ), + const SizedBox(height: 24), + const Text( '榴莲皇后', style: TextStyle( fontSize: 32, @@ -420,25 +378,11 @@ class _SplashPageState extends ConsumerState color: Color(0xFF4A3F35), ), ), - ), - const SizedBox(height: 16), - // 副标题(延迟显示) - Opacity( - opacity: _textOpacityAnimation?.value ?? 1.0, - child: const Text( - '认种榴莲 · 共享收益', - style: TextStyle( - fontSize: 16, - fontFamily: 'Noto Sans SC', - fontWeight: FontWeight.w400, - color: Color(0xFF8B7355), - ), - ), - ), - ], - ), - ); - }, + ], + ), + ); + }, + ), ); } diff --git a/frontend/mobile-app/pubspec.yaml b/frontend/mobile-app/pubspec.yaml index 01e7fd5f..67ff23a5 100644 --- a/frontend/mobile-app/pubspec.yaml +++ b/frontend/mobile-app/pubspec.yaml @@ -107,6 +107,7 @@ flutter: - assets/images/backgrounds/ - assets/images/avatars/ - assets/images/illustrations/ + - assets/images/splash_frames/ - assets/icons/ - assets/icons/nav/ - assets/icons/tokens/