From 1ce980a87b77b7df45ac9ad374adfdac67a54572 Mon Sep 17 00:00:00 2001 From: efrilm Date: Sun, 12 Oct 2025 13:27:39 +0700 Subject: [PATCH] mystery box --- lib/env.dart | 5 +- .../datasources/remote_data_provider.dart | 4 +- lib/injection.config.dart | 6 +- .../components/assets/assets.gen.dart | 33 + .../pages/home/widgets/feature_section.dart | 74 +- .../mistery_box/mistery_box_page.dart | 880 ++++++++++++++++++ lib/presentation/router/app_router.dart | 1 + lib/presentation/router/app_router.gr.dart | 378 ++++---- 8 files changed, 1165 insertions(+), 216 deletions(-) create mode 100644 lib/presentation/pages/mini_games/mistery_box/mistery_box_page.dart diff --git a/lib/env.dart b/lib/env.dart index 031e483..d6c9035 100644 --- a/lib/env.dart +++ b/lib/env.dart @@ -9,12 +9,13 @@ abstract class Env { @dev class DevEnv implements Env { @override - String get baseUrl => 'http://192.168.1.30:4000'; // example value + // String get baseUrl => 'http://192.168.1.30:4000'; // example value + String get baseUrl => 'https://api-pos.apskel.id'; // example value } @Injectable(as: Env) @prod class ProdEnv implements Env { @override - String get baseUrl => 'https://enaklo-pos-be.altru.id'; + String get baseUrl => 'https://api-pos.apskel.id'; } diff --git a/lib/infrastructure/auth/datasources/remote_data_provider.dart b/lib/infrastructure/auth/datasources/remote_data_provider.dart index 579a3ae..f8e7256 100644 --- a/lib/infrastructure/auth/datasources/remote_data_provider.dart +++ b/lib/infrastructure/auth/datasources/remote_data_provider.dart @@ -211,7 +211,9 @@ class AuthRemoteDataProvider { if ((response.data['errors'] as List).isNotEmpty) { if (response.data['errors'][0]['code'] == "900") { return DC.error( - AuthFailure.dynamicErrorMessage('Kamu Belum Terdaftar'), + AuthFailure.dynamicErrorMessage( + response.data['errors'][0]['cause'], + ), ); } else { return DC.error( diff --git a/lib/injection.config.dart b/lib/injection.config.dart index 5bcec36..858c417 100644 --- a/lib/injection.config.dart +++ b/lib/injection.config.dart @@ -124,12 +124,12 @@ extension GetItInjectableX on _i174.GetIt { gh.factory<_i869.CheckPhoneFormBloc>( () => _i869.CheckPhoneFormBloc(gh<_i995.IAuthRepository>()), ); - gh.factory<_i521.VerifyFormBloc>( - () => _i521.VerifyFormBloc(gh<_i995.IAuthRepository>()), - ); gh.factory<_i771.AuthBloc>( () => _i771.AuthBloc(gh<_i995.IAuthRepository>()), ); + gh.factory<_i521.VerifyFormBloc>( + () => _i521.VerifyFormBloc(gh<_i995.IAuthRepository>()), + ); gh.factory<_i216.LogoutFormBloc>( () => _i216.LogoutFormBloc(gh<_i995.IAuthRepository>()), ); diff --git a/lib/presentation/components/assets/assets.gen.dart b/lib/presentation/components/assets/assets.gen.dart index 4ca2ee5..43f7785 100644 --- a/lib/presentation/components/assets/assets.gen.dart +++ b/lib/presentation/components/assets/assets.gen.dart @@ -11,6 +11,38 @@ import 'package:flutter/widgets.dart'; +class $AssetsAudioGen { + const $AssetsAudioGen(); + + /// File path: assets/audio/bell_ding.mp3 + String get bellDing => 'assets/audio/bell_ding.mp3'; + + /// File path: assets/audio/big_win.mp3 + String get bigWin => 'assets/audio/big_win.mp3'; + + /// File path: assets/audio/button_tap.mp3 + String get buttonTap => 'assets/audio/button_tap.mp3'; + + /// File path: assets/audio/carnaval_main_theme.mp3 + String get carnavalMainTheme => 'assets/audio/carnaval_main_theme.mp3'; + + /// File path: assets/audio/token_sound.mp3 + String get tokenSound => 'assets/audio/token_sound.mp3'; + + /// File path: assets/audio/wheel_spin.mp3 + String get wheelSpin => 'assets/audio/wheel_spin.mp3'; + + /// List of all assets + List get values => [ + bellDing, + bigWin, + buttonTap, + carnavalMainTheme, + tokenSound, + wheelSpin, + ]; +} + class $AssetsImagesGen { const $AssetsImagesGen(); @@ -64,6 +96,7 @@ class $AssetsImagesGen { class Assets { const Assets._(); + static const $AssetsAudioGen audio = $AssetsAudioGen(); static const $AssetsImagesGen images = $AssetsImagesGen(); } diff --git a/lib/presentation/pages/main/pages/home/widgets/feature_section.dart b/lib/presentation/pages/main/pages/home/widgets/feature_section.dart index bda479a..ff7d443 100644 --- a/lib/presentation/pages/main/pages/home/widgets/feature_section.dart +++ b/lib/presentation/pages/main/pages/home/widgets/feature_section.dart @@ -14,36 +14,50 @@ class HomeFeatureSection extends StatelessWidget { builder: (context, state) { return Container( padding: const EdgeInsets.all(16), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - HomeFeatureCard( - icon: Icons.card_giftcard, - title: 'Reward', - iconColor: const Color(0xFF1976D2), - onTap: () => context.router.push(RewardRoute()), - ), - HomeFeatureCard( - icon: Icons.casino, - title: 'Undian', - iconColor: const Color(0xFF7B1FA2), - onTap: () => context.router.push(DrawRoute()), - ), - HomeFeatureCard( - icon: Icons.store, - title: 'Merchant', - iconColor: const Color(0xFF388E3C), - onTap: () => context.router.push(MerchantRoute()), - ), - HomeFeatureCard( - icon: Icons.blur_circular, - title: 'Wheels', - iconColor: const Color(0xFF388E3C), - onTap: () => state.isAuthenticated - ? context.router.push(FerrisWheelRoute()) - : context.router.push(OnboardingRoute()), - ), - ], + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + HomeFeatureCard( + icon: Icons.card_giftcard, + title: 'Reward', + iconColor: const Color(0xFF1976D2), + onTap: () => context.router.push(RewardRoute()), + ), + SizedBox(width: 12), + HomeFeatureCard( + icon: Icons.casino, + title: 'Undian', + iconColor: const Color(0xFF7B1FA2), + onTap: () => context.router.push(DrawRoute()), + ), + SizedBox(width: 12), + HomeFeatureCard( + icon: Icons.store, + title: 'Merchant', + iconColor: const Color(0xFF388E3C), + onTap: () => context.router.push(MerchantRoute()), + ), + SizedBox(width: 12), + HomeFeatureCard( + icon: Icons.blur_circular, + title: 'Wheels', + iconColor: const Color(0xFF388E3C), + onTap: () => state.isAuthenticated + ? context.router.push(FerrisWheelRoute()) + : context.router.push(OnboardingRoute()), + ), + SizedBox(width: 12), + HomeFeatureCard( + icon: Icons.storage_outlined, + title: 'Mistery Box', + iconColor: const Color(0xFF388E3C), + onTap: () => state.isAuthenticated + ? context.router.push(MisteryBoxRoute()) + : context.router.push(OnboardingRoute()), + ), + ], + ), ), ); }, diff --git a/lib/presentation/pages/mini_games/mistery_box/mistery_box_page.dart b/lib/presentation/pages/mini_games/mistery_box/mistery_box_page.dart new file mode 100644 index 0000000..7907af8 --- /dev/null +++ b/lib/presentation/pages/mini_games/mistery_box/mistery_box_page.dart @@ -0,0 +1,880 @@ +import 'dart:math'; + +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; + +import '../../../../common/theme/theme.dart'; + +@RoutePage() +class MisteryBoxPage extends StatefulWidget { + const MisteryBoxPage({super.key}); + + @override + State createState() => _MisteryBoxPageState(); +} + +class _MisteryBoxPageState extends State + with TickerProviderStateMixin { + int coins = 100; + int totalWins = 0; + List prizes = [ + Prize( + name: 'Voucher Rp 100K', + type: 'Voucher', + value: 100000, + rarity: 'Legendary', + chance: 5, + icon: '🎁', + ), + Prize( + name: 'Cashback 50%', + type: 'Cashback', + value: 50, + rarity: 'Epic', + chance: 10, + icon: '💰', + ), + Prize( + name: '500 Poin Reward', + type: 'Poin', + value: 500, + rarity: 'Rare', + chance: 15, + icon: '🏆', + ), + Prize( + name: 'Voucher Rp 25K', + type: 'Voucher', + value: 25000, + rarity: 'Uncommon', + chance: 25, + icon: '🎫', + ), + Prize( + name: '100 Poin Reward', + type: 'Poin', + value: 100, + rarity: 'Common', + chance: 30, + icon: '⭐', + ), + Prize( + name: 'Diskon 10%', + type: 'Diskon', + value: 10, + rarity: 'Common', + chance: 15, + icon: '🍕', + ), + ]; + + bool isOpening = false; + late AnimationController _shakeController; + late AnimationController _rotateController; + late Animation _shakeAnimation; + late Animation _rotateAnimation; + + @override + void initState() { + super.initState(); + _shakeController = AnimationController( + duration: const Duration(milliseconds: 600), + vsync: this, + ); + _rotateController = AnimationController( + duration: const Duration(milliseconds: 600), + vsync: this, + ); + + _shakeAnimation = Tween(begin: 0, end: 15).animate( + CurvedAnimation(parent: _shakeController, curve: Curves.elasticIn), + ); + _rotateAnimation = Tween(begin: 0, end: 2 * pi).animate( + CurvedAnimation(parent: _rotateController, curve: Curves.easeInOut), + ); + } + + @override + void dispose() { + _shakeController.dispose(); + _rotateController.dispose(); + super.dispose(); + } + + void openBox() async { + if (coins < 10 || isOpening) return; + + setState(() { + isOpening = true; + coins -= 10; + }); + + // Animasi shake dan rotate + _shakeController.repeat(reverse: true); + _rotateController.forward(); + await Future.delayed(const Duration(milliseconds: 1200)); + _shakeController.stop(); + _rotateController.reset(); + + // Generate prize + Prize prize = _generatePrize(); + + setState(() { + totalWins++; + isOpening = false; + }); + + // Show dialog + if (mounted) { + _showPrizeDialog(prize); + } + } + + Prize _generatePrize() { + int random = Random().nextInt(100); + int cumulativeChance = 0; + + for (var prize in prizes) { + cumulativeChance += prize.chance; + if (random < cumulativeChance) { + return prize; + } + } + return prizes.last; + } + + void _showPrizeDialog(Prize prize) { + showDialog( + context: context, + barrierDismissible: false, + builder: (context) => PrizeDialog(prize: prize), + ); + } + + Color _getRarityColor(String rarity) { + switch (rarity) { + case 'Legendary': + return const Color(0xFFFFD700); + case 'Epic': + return const Color(0xFFB429F9); + case 'Rare': + return const Color(0xFF3B82F6); + case 'Uncommon': + return const Color(0xFF10B981); + default: + return const Color(0xFF9CA3AF); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + AppColor.primary, + AppColor.primaryDark, + const Color(0xFF4A0000), + ], + ), + ), + child: SafeArea( + child: Column( + children: [ + _buildHeader(), + Expanded( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _buildMysteryBox(), + const SizedBox(height: 40), + _buildOpenButton(), + const SizedBox(height: 24), + _buildPrizeListButton(), + ], + ), + ), + ), + ], + ), + ), + ), + ); + } + + Widget _buildHeader() { + return Padding( + padding: const EdgeInsets.all(16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '🎁 Mystery Box', + style: AppStyle.h5.copyWith( + color: AppColor.white, + fontWeight: FontWeight.bold, + ), + ), + Text( + 'Win Amazing Rewards!', + style: AppStyle.xs.copyWith( + color: AppColor.white.withOpacity(0.8), + ), + ), + ], + ), + ), + Row( + children: [ + _buildStatCard('🪙', coins.toString()), + const SizedBox(width: 8), + _buildStatCard('🏆', totalWins.toString()), + ], + ), + ], + ), + ); + } + + Widget _buildStatCard(String icon, String value) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), + decoration: BoxDecoration( + color: AppColor.white.withOpacity(0.2), + borderRadius: BorderRadius.circular(16), + border: Border.all(color: AppColor.white.withOpacity(0.3), width: 1.5), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text(icon, style: const TextStyle(fontSize: 16)), + const SizedBox(width: 6), + Text( + value, + style: AppStyle.md.copyWith( + color: AppColor.white, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ); + } + + Widget _buildMysteryBox() { + return AnimatedBuilder( + animation: Listenable.merge([_shakeAnimation, _rotateAnimation]), + builder: (context, child) { + return Transform.translate( + offset: Offset( + sin(_shakeAnimation.value) * 10, + cos(_shakeAnimation.value) * 5, + ), + child: Transform.rotate( + angle: _rotateAnimation.value, + child: Container( + width: 200, + height: 200, + decoration: BoxDecoration( + color: AppColor.white, + borderRadius: BorderRadius.circular(24), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.3), + blurRadius: 30, + offset: const Offset(0, 15), + ), + BoxShadow( + color: AppColor.warning.withOpacity(0.5), + blurRadius: 50, + spreadRadius: isOpening ? 8 : 0, + ), + ], + ), + child: Stack( + children: [ + Positioned( + top: 15, + left: 15, + child: Container( + width: 30, + height: 30, + decoration: BoxDecoration( + color: AppColor.warning.withOpacity(0.2), + shape: BoxShape.circle, + ), + ), + ), + Positioned( + bottom: 20, + right: 20, + child: Container( + width: 25, + height: 25, + decoration: BoxDecoration( + color: AppColor.success.withOpacity(0.2), + shape: BoxShape.circle, + ), + ), + ), + Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text('🎁', style: TextStyle(fontSize: 70)), + const SizedBox(height: 8), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 4, + ), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: AppColor.primaryGradient, + ), + borderRadius: BorderRadius.circular(16), + ), + child: Text( + 'Mystery Box', + style: AppStyle.sm.copyWith( + color: AppColor.white, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + ), + if (isOpening) ...[ + const Positioned( + top: 25, + right: 25, + child: Text('✨', style: TextStyle(fontSize: 24)), + ), + const Positioned( + bottom: 30, + left: 25, + child: Text('✨', style: TextStyle(fontSize: 24)), + ), + const Positioned( + top: 50, + left: 30, + child: Text('⭐', style: TextStyle(fontSize: 20)), + ), + ], + ], + ), + ), + ), + ); + }, + ); + } + + Widget _buildOpenButton() { + bool canOpen = coins >= 10 && !isOpening; + + return GestureDetector( + onTap: canOpen ? openBox : null, + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 16), + decoration: BoxDecoration( + color: canOpen ? AppColor.white : AppColor.white.withOpacity(0.3), + borderRadius: BorderRadius.circular(25), + boxShadow: canOpen + ? [ + BoxShadow( + color: AppColor.white.withOpacity(0.3), + blurRadius: 15, + offset: const Offset(0, 6), + ), + ] + : [], + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + isOpening ? Icons.refresh : Icons.card_giftcard, + color: canOpen ? AppColor.primary : AppColor.textLight, + size: 24, + ), + const SizedBox(width: 10), + Text( + isOpening ? 'Membuka...' : 'Buka Box', + style: AppStyle.lg.copyWith( + color: canOpen ? AppColor.primary : AppColor.textLight, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3), + decoration: BoxDecoration( + color: canOpen + ? AppColor.warning.withOpacity(0.2) + : AppColor.textLight.withOpacity(0.2), + borderRadius: BorderRadius.circular(10), + ), + child: Text( + '10 🪙', + style: AppStyle.xs.copyWith( + color: canOpen ? AppColor.warning : AppColor.textLight, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + ), + ); + } + + Widget _buildPrizeListButton() { + return GestureDetector( + onTap: () { + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + isScrollControlled: true, + builder: (context) => _buildPrizeListModal(), + ); + }, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 12), + decoration: BoxDecoration( + color: AppColor.white.withOpacity(0.2), + borderRadius: BorderRadius.circular(20), + border: Border.all(color: AppColor.white.withOpacity(0.3), width: 2), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon(Icons.emoji_events, color: AppColor.white, size: 20), + const SizedBox(width: 8), + Text( + 'Lihat Hadiah Tersedia', + style: AppStyle.sm.copyWith( + color: AppColor.white, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(width: 4), + const Icon( + Icons.arrow_forward_ios, + color: AppColor.white, + size: 14, + ), + ], + ), + ), + ); + } + + Widget _buildPrizeListModal() { + return Container( + height: MediaQuery.of(context).size.height * 0.7, + decoration: const BoxDecoration( + color: AppColor.white, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + children: [ + // Handle bar + Container( + margin: const EdgeInsets.only(top: 12), + width: 40, + height: 4, + decoration: BoxDecoration( + color: AppColor.textLight, + borderRadius: BorderRadius.circular(2), + ), + ), + // Header + Padding( + padding: const EdgeInsets.all(20), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Hadiah Tersedia', + style: AppStyle.h5.copyWith( + fontWeight: FontWeight.bold, + color: AppColor.textPrimary, + ), + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 4, + ), + decoration: BoxDecoration( + color: AppColor.primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(12), + ), + child: Text( + '${prizes.length} Items', + style: AppStyle.xs.copyWith( + color: AppColor.primary, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + ), + // Prize Grid + Expanded( + child: GridView.builder( + padding: const EdgeInsets.symmetric(horizontal: 20), + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + childAspectRatio: 0.70, + crossAxisSpacing: 12, + mainAxisSpacing: 12, + ), + itemCount: prizes.length, + itemBuilder: (context, index) { + final prize = prizes[index]; + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + _getRarityColor(prize.rarity).withOpacity(0.1), + _getRarityColor(prize.rarity).withOpacity(0.05), + ], + ), + borderRadius: BorderRadius.circular(20), + border: Border.all( + color: _getRarityColor(prize.rarity).withOpacity(0.4), + width: 2, + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(prize.icon, style: const TextStyle(fontSize: 40)), + const SizedBox(height: 12), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 4, + ), + decoration: BoxDecoration( + color: _getRarityColor(prize.rarity), + borderRadius: BorderRadius.circular(12), + ), + child: Text( + prize.rarity, + style: AppStyle.xs.copyWith( + color: AppColor.white, + fontWeight: FontWeight.bold, + fontSize: 9, + ), + ), + ), + const SizedBox(height: 8), + Text( + prize.name, + style: AppStyle.sm.copyWith( + fontWeight: FontWeight.bold, + color: AppColor.textPrimary, + ), + textAlign: TextAlign.center, + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + const SizedBox(height: 4), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 3, + ), + decoration: BoxDecoration( + color: AppColor.primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(8), + ), + child: Text( + prize.type, + style: AppStyle.xs.copyWith( + color: AppColor.primary, + fontWeight: FontWeight.w600, + fontSize: 10, + ), + ), + ), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 3, + ), + decoration: BoxDecoration( + color: _getRarityColor( + prize.rarity, + ).withOpacity(0.2), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.percent, + size: 10, + color: _getRarityColor(prize.rarity), + ), + const SizedBox(width: 2), + Text( + '${prize.chance}%', + style: AppStyle.xs.copyWith( + color: _getRarityColor(prize.rarity), + fontWeight: FontWeight.bold, + fontSize: 10, + ), + ), + ], + ), + ), + ], + ), + ], + ), + ); + }, + ), + ), + const SizedBox(height: 20), + ], + ), + ); + } +} + +class PrizeDialog extends StatefulWidget { + final Prize prize; + + const PrizeDialog({Key? key, required this.prize}) : super(key: key); + + @override + State createState() => _PrizeDialogState(); +} + +class _PrizeDialogState extends State + with SingleTickerProviderStateMixin { + late AnimationController _controller; + late Animation _scaleAnimation; + late Animation _fadeAnimation; + + @override + void initState() { + super.initState(); + _controller = AnimationController( + duration: const Duration(milliseconds: 500), + vsync: this, + ); + + _scaleAnimation = Tween( + begin: 0.5, + end: 1.0, + ).animate(CurvedAnimation(parent: _controller, curve: Curves.elasticOut)); + + _fadeAnimation = Tween( + begin: 0.0, + end: 1.0, + ).animate(CurvedAnimation(parent: _controller, curve: Curves.easeIn)); + + _controller.forward(); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + Color _getRarityColor(String rarity) { + switch (rarity) { + case 'Legendary': + return const Color(0xFFFFD700); + case 'Epic': + return const Color(0xFFB429F9); + case 'Rare': + return const Color(0xFF3B82F6); + case 'Uncommon': + return const Color(0xFF10B981); + default: + return const Color(0xFF9CA3AF); + } + } + + @override + Widget build(BuildContext context) { + return FadeTransition( + opacity: _fadeAnimation, + child: Dialog( + backgroundColor: Colors.transparent, + child: ScaleTransition( + scale: _scaleAnimation, + child: Container( + constraints: const BoxConstraints(maxWidth: 320), + padding: const EdgeInsets.all(24), + decoration: BoxDecoration( + color: AppColor.white, + borderRadius: BorderRadius.circular(24), + border: Border.all( + color: _getRarityColor(widget.prize.rarity), + width: 4, + ), + boxShadow: [ + BoxShadow( + color: _getRarityColor(widget.prize.rarity).withOpacity(0.5), + blurRadius: 30, + offset: const Offset(0, 10), + spreadRadius: 2, + ), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('🎉', style: const TextStyle(fontSize: 50)), + const SizedBox(height: 12), + Text( + 'Selamat!', + style: AppStyle.h4.copyWith( + fontWeight: FontWeight.bold, + color: AppColor.textPrimary, + ), + ), + const SizedBox(height: 8), + Text( + 'Kamu mendapatkan', + style: AppStyle.sm.copyWith(color: AppColor.textSecondary), + ), + const SizedBox(height: 16), + Text(widget.prize.icon, style: const TextStyle(fontSize: 60)), + const SizedBox(height: 12), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 14, + vertical: 6, + ), + decoration: BoxDecoration( + color: _getRarityColor(widget.prize.rarity), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: _getRarityColor( + widget.prize.rarity, + ).withOpacity(0.4), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: Text( + widget.prize.rarity.toUpperCase(), + style: AppStyle.xs.copyWith( + color: AppColor.white, + fontWeight: FontWeight.bold, + letterSpacing: 1.2, + ), + ), + ), + const SizedBox(height: 16), + Text( + widget.prize.name, + style: AppStyle.h5.copyWith( + fontWeight: FontWeight.bold, + color: AppColor.textPrimary, + ), + textAlign: TextAlign.center, + ), + const SizedBox(height: 8), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 4, + ), + decoration: BoxDecoration( + color: AppColor.primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(12), + ), + child: Text( + widget.prize.type, + style: AppStyle.xs.copyWith( + color: AppColor.primary, + fontWeight: FontWeight.w600, + ), + ), + ), + const SizedBox(height: 24), + GestureDetector( + onTap: () => Navigator.pop(context), + child: Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(vertical: 14), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: AppColor.primaryGradient, + ), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: AppColor.primary.withOpacity(0.4), + blurRadius: 12, + offset: const Offset(0, 4), + ), + ], + ), + child: Text( + 'Tutup', + style: AppStyle.md.copyWith( + color: AppColor.white, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.center, + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} + +class Prize { + final String name; + final String type; + final int value; + final String rarity; + final int chance; + final String icon; + + Prize({ + required this.name, + required this.type, + required this.value, + required this.rarity, + required this.chance, + required this.icon, + }); +} diff --git a/lib/presentation/router/app_router.dart b/lib/presentation/router/app_router.dart index 32f0bad..1104f6a 100644 --- a/lib/presentation/router/app_router.dart +++ b/lib/presentation/router/app_router.dart @@ -70,5 +70,6 @@ class AppRouter extends RootStackRouter { // Mini Games AutoRoute(page: FerrisWheelRoute.page), + AutoRoute(page: MisteryBoxRoute.page), ]; } diff --git a/lib/presentation/router/app_router.gr.dart b/lib/presentation/router/app_router.gr.dart index af27992..22e0e5b 100644 --- a/lib/presentation/router/app_router.gr.dart +++ b/lib/presentation/router/app_router.gr.dart @@ -9,22 +9,22 @@ // coverage:ignore-file // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i33; +import 'package:auto_route/auto_route.dart' as _i34; import 'package:enaklo/presentation/pages/account/account_my/account_my_page.dart' as _i1; import 'package:enaklo/presentation/pages/account/address/address_page.dart' as _i2; import 'package:enaklo/presentation/pages/account/payment/payment_page.dart' - as _i22; + as _i23; import 'package:enaklo/presentation/pages/auth/create_password/create_password_page.dart' as _i3; import 'package:enaklo/presentation/pages/auth/login/login_page.dart' as _i12; -import 'package:enaklo/presentation/pages/auth/otp/otp_page.dart' as _i20; +import 'package:enaklo/presentation/pages/auth/otp/otp_page.dart' as _i21; import 'package:enaklo/presentation/pages/auth/password/password_page.dart' - as _i21; -import 'package:enaklo/presentation/pages/auth/pin/pin_page.dart' as _i23; + as _i22; +import 'package:enaklo/presentation/pages/auth/pin/pin_page.dart' as _i24; import 'package:enaklo/presentation/pages/auth/register/register_page.dart' - as _i28; + as _i29; import 'package:enaklo/presentation/pages/draw/draw_page.dart' as _i7; import 'package:enaklo/presentation/pages/draw/pages/draw_detail/draw_detail_page.dart' as _i4; @@ -40,43 +40,45 @@ import 'package:enaklo/presentation/pages/main/main_page.dart' as _i13; import 'package:enaklo/presentation/pages/main/pages/home/home_page.dart' as _i11; import 'package:enaklo/presentation/pages/main/pages/order/order_page.dart' - as _i19; + as _i20; import 'package:enaklo/presentation/pages/main/pages/profile/profile_page.dart' - as _i27; + as _i28; import 'package:enaklo/presentation/pages/main/pages/voucher/voucher_page.dart' - as _i32; + as _i33; import 'package:enaklo/presentation/pages/merchant/merchant_page.dart' as _i15; import 'package:enaklo/presentation/pages/merchant/pages/merchant_detail/merchant_detail_page.dart' as _i14; import 'package:enaklo/presentation/pages/mini_games/ferris_wheel/ferris_wheel_page.dart' as _i10; -import 'package:enaklo/presentation/pages/notification/notification_page.dart' +import 'package:enaklo/presentation/pages/mini_games/mistery_box/mistery_box_page.dart' as _i16; -import 'package:enaklo/presentation/pages/onboarding/onboarding_page.dart' +import 'package:enaklo/presentation/pages/notification/notification_page.dart' as _i17; -import 'package:enaklo/presentation/pages/order/order_detail/order_detail_page.dart' +import 'package:enaklo/presentation/pages/onboarding/onboarding_page.dart' as _i18; +import 'package:enaklo/presentation/pages/order/order_detail/order_detail_page.dart' + as _i19; import 'package:enaklo/presentation/pages/poin/pages/poin_history_page.dart' - as _i24; + as _i25; import 'package:enaklo/presentation/pages/poin/pages/product_redeem/product_redeem_page.dart' - as _i26; -import 'package:enaklo/presentation/pages/poin/poin_page.dart' as _i25; -import 'package:enaklo/presentation/pages/reward/reward_page.dart' as _i29; -import 'package:enaklo/presentation/pages/splash/splash_page.dart' as _i30; + as _i27; +import 'package:enaklo/presentation/pages/poin/poin_page.dart' as _i26; +import 'package:enaklo/presentation/pages/reward/reward_page.dart' as _i30; +import 'package:enaklo/presentation/pages/splash/splash_page.dart' as _i31; import 'package:enaklo/presentation/pages/voucher/voucher_detail/voucher_detail_page.dart' - as _i31; -import 'package:enaklo/sample/sample_data.dart' as _i35; -import 'package:flutter/material.dart' as _i34; + as _i32; +import 'package:enaklo/sample/sample_data.dart' as _i36; +import 'package:flutter/material.dart' as _i35; /// generated route for /// [_i1.AccountMyPage] -class AccountMyRoute extends _i33.PageRouteInfo { - const AccountMyRoute({List<_i33.PageRouteInfo>? children}) +class AccountMyRoute extends _i34.PageRouteInfo { + const AccountMyRoute({List<_i34.PageRouteInfo>? children}) : super(AccountMyRoute.name, initialChildren: children); static const String name = 'AccountMyRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i1.AccountMyPage(); @@ -86,13 +88,13 @@ class AccountMyRoute extends _i33.PageRouteInfo { /// generated route for /// [_i2.AddressPage] -class AddressRoute extends _i33.PageRouteInfo { - const AddressRoute({List<_i33.PageRouteInfo>? children}) +class AddressRoute extends _i34.PageRouteInfo { + const AddressRoute({List<_i34.PageRouteInfo>? children}) : super(AddressRoute.name, initialChildren: children); static const String name = 'AddressRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i2.AddressPage(); @@ -102,11 +104,11 @@ class AddressRoute extends _i33.PageRouteInfo { /// generated route for /// [_i3.CreatePasswordPage] -class CreatePasswordRoute extends _i33.PageRouteInfo { +class CreatePasswordRoute extends _i34.PageRouteInfo { CreatePasswordRoute({ - _i34.Key? key, + _i35.Key? key, required String registrationToken, - List<_i33.PageRouteInfo>? children, + List<_i34.PageRouteInfo>? children, }) : super( CreatePasswordRoute.name, args: CreatePasswordRouteArgs( @@ -118,11 +120,11 @@ class CreatePasswordRoute extends _i33.PageRouteInfo { static const String name = 'CreatePasswordRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i33.WrappedRoute( + return _i34.WrappedRoute( child: _i3.CreatePasswordPage( key: args.key, registrationToken: args.registrationToken, @@ -135,7 +137,7 @@ class CreatePasswordRoute extends _i33.PageRouteInfo { class CreatePasswordRouteArgs { const CreatePasswordRouteArgs({this.key, required this.registrationToken}); - final _i34.Key? key; + final _i35.Key? key; final String registrationToken; @@ -147,13 +149,13 @@ class CreatePasswordRouteArgs { /// generated route for /// [_i4.DrawDetailPage] -class DrawDetailRoute extends _i33.PageRouteInfo { - const DrawDetailRoute({List<_i33.PageRouteInfo>? children}) +class DrawDetailRoute extends _i34.PageRouteInfo { + const DrawDetailRoute({List<_i34.PageRouteInfo>? children}) : super(DrawDetailRoute.name, initialChildren: children); static const String name = 'DrawDetailRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i4.DrawDetailPage(); @@ -163,13 +165,13 @@ class DrawDetailRoute extends _i33.PageRouteInfo { /// generated route for /// [_i5.DrawInfoPage] -class DrawInfoRoute extends _i33.PageRouteInfo { - const DrawInfoRoute({List<_i33.PageRouteInfo>? children}) +class DrawInfoRoute extends _i34.PageRouteInfo { + const DrawInfoRoute({List<_i34.PageRouteInfo>? children}) : super(DrawInfoRoute.name, initialChildren: children); static const String name = 'DrawInfoRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i5.DrawInfoPage(); @@ -179,13 +181,13 @@ class DrawInfoRoute extends _i33.PageRouteInfo { /// generated route for /// [_i6.DrawMyNumberPage] -class DrawMyNumberRoute extends _i33.PageRouteInfo { - const DrawMyNumberRoute({List<_i33.PageRouteInfo>? children}) +class DrawMyNumberRoute extends _i34.PageRouteInfo { + const DrawMyNumberRoute({List<_i34.PageRouteInfo>? children}) : super(DrawMyNumberRoute.name, initialChildren: children); static const String name = 'DrawMyNumberRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i6.DrawMyNumberPage(); @@ -195,13 +197,13 @@ class DrawMyNumberRoute extends _i33.PageRouteInfo { /// generated route for /// [_i7.DrawPage] -class DrawRoute extends _i33.PageRouteInfo { - const DrawRoute({List<_i33.PageRouteInfo>? children}) +class DrawRoute extends _i34.PageRouteInfo { + const DrawRoute({List<_i34.PageRouteInfo>? children}) : super(DrawRoute.name, initialChildren: children); static const String name = 'DrawRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i7.DrawPage(); @@ -211,13 +213,13 @@ class DrawRoute extends _i33.PageRouteInfo { /// generated route for /// [_i8.DrawTodayPage] -class DrawTodayRoute extends _i33.PageRouteInfo { - const DrawTodayRoute({List<_i33.PageRouteInfo>? children}) +class DrawTodayRoute extends _i34.PageRouteInfo { + const DrawTodayRoute({List<_i34.PageRouteInfo>? children}) : super(DrawTodayRoute.name, initialChildren: children); static const String name = 'DrawTodayRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i8.DrawTodayPage(); @@ -227,13 +229,13 @@ class DrawTodayRoute extends _i33.PageRouteInfo { /// generated route for /// [_i9.DrawWinnerPage] -class DrawWinnerRoute extends _i33.PageRouteInfo { - const DrawWinnerRoute({List<_i33.PageRouteInfo>? children}) +class DrawWinnerRoute extends _i34.PageRouteInfo { + const DrawWinnerRoute({List<_i34.PageRouteInfo>? children}) : super(DrawWinnerRoute.name, initialChildren: children); static const String name = 'DrawWinnerRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i9.DrawWinnerPage(); @@ -243,29 +245,29 @@ class DrawWinnerRoute extends _i33.PageRouteInfo { /// generated route for /// [_i10.FerrisWheelPage] -class FerrisWheelRoute extends _i33.PageRouteInfo { - const FerrisWheelRoute({List<_i33.PageRouteInfo>? children}) +class FerrisWheelRoute extends _i34.PageRouteInfo { + const FerrisWheelRoute({List<_i34.PageRouteInfo>? children}) : super(FerrisWheelRoute.name, initialChildren: children); static const String name = 'FerrisWheelRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return _i33.WrappedRoute(child: const _i10.FerrisWheelPage()); + return _i34.WrappedRoute(child: const _i10.FerrisWheelPage()); }, ); } /// generated route for /// [_i11.HomePage] -class HomeRoute extends _i33.PageRouteInfo { - const HomeRoute({List<_i33.PageRouteInfo>? children}) +class HomeRoute extends _i34.PageRouteInfo { + const HomeRoute({List<_i34.PageRouteInfo>? children}) : super(HomeRoute.name, initialChildren: children); static const String name = 'HomeRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i11.HomePage(); @@ -275,29 +277,29 @@ class HomeRoute extends _i33.PageRouteInfo { /// generated route for /// [_i12.LoginPage] -class LoginRoute extends _i33.PageRouteInfo { - const LoginRoute({List<_i33.PageRouteInfo>? children}) +class LoginRoute extends _i34.PageRouteInfo { + const LoginRoute({List<_i34.PageRouteInfo>? children}) : super(LoginRoute.name, initialChildren: children); static const String name = 'LoginRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return _i33.WrappedRoute(child: const _i12.LoginPage()); + return _i34.WrappedRoute(child: const _i12.LoginPage()); }, ); } /// generated route for /// [_i13.MainPage] -class MainRoute extends _i33.PageRouteInfo { - const MainRoute({List<_i33.PageRouteInfo>? children}) +class MainRoute extends _i34.PageRouteInfo { + const MainRoute({List<_i34.PageRouteInfo>? children}) : super(MainRoute.name, initialChildren: children); static const String name = 'MainRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i13.MainPage(); @@ -307,11 +309,11 @@ class MainRoute extends _i33.PageRouteInfo { /// generated route for /// [_i14.MerchantDetailPage] -class MerchantDetailRoute extends _i33.PageRouteInfo { +class MerchantDetailRoute extends _i34.PageRouteInfo { MerchantDetailRoute({ - _i34.Key? key, - required _i35.MerchantModel merchant, - List<_i33.PageRouteInfo>? children, + _i35.Key? key, + required _i36.MerchantModel merchant, + List<_i34.PageRouteInfo>? children, }) : super( MerchantDetailRoute.name, args: MerchantDetailRouteArgs(key: key, merchant: merchant), @@ -320,7 +322,7 @@ class MerchantDetailRoute extends _i33.PageRouteInfo { static const String name = 'MerchantDetailRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { final args = data.argsAs(); @@ -332,9 +334,9 @@ class MerchantDetailRoute extends _i33.PageRouteInfo { class MerchantDetailRouteArgs { const MerchantDetailRouteArgs({this.key, required this.merchant}); - final _i34.Key? key; + final _i35.Key? key; - final _i35.MerchantModel merchant; + final _i36.MerchantModel merchant; @override String toString() { @@ -344,13 +346,13 @@ class MerchantDetailRouteArgs { /// generated route for /// [_i15.MerchantPage] -class MerchantRoute extends _i33.PageRouteInfo { - const MerchantRoute({List<_i33.PageRouteInfo>? children}) +class MerchantRoute extends _i34.PageRouteInfo { + const MerchantRoute({List<_i34.PageRouteInfo>? children}) : super(MerchantRoute.name, initialChildren: children); static const String name = 'MerchantRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { return const _i15.MerchantPage(); @@ -359,44 +361,60 @@ class MerchantRoute extends _i33.PageRouteInfo { } /// generated route for -/// [_i16.NotificationPage] -class NotificationRoute extends _i33.PageRouteInfo { - const NotificationRoute({List<_i33.PageRouteInfo>? children}) +/// [_i16.MisteryBoxPage] +class MisteryBoxRoute extends _i34.PageRouteInfo { + const MisteryBoxRoute({List<_i34.PageRouteInfo>? children}) + : super(MisteryBoxRoute.name, initialChildren: children); + + static const String name = 'MisteryBoxRoute'; + + static _i34.PageInfo page = _i34.PageInfo( + name, + builder: (data) { + return const _i16.MisteryBoxPage(); + }, + ); +} + +/// generated route for +/// [_i17.NotificationPage] +class NotificationRoute extends _i34.PageRouteInfo { + const NotificationRoute({List<_i34.PageRouteInfo>? children}) : super(NotificationRoute.name, initialChildren: children); static const String name = 'NotificationRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return const _i16.NotificationPage(); + return const _i17.NotificationPage(); }, ); } /// generated route for -/// [_i17.OnboardingPage] -class OnboardingRoute extends _i33.PageRouteInfo { - const OnboardingRoute({List<_i33.PageRouteInfo>? children}) +/// [_i18.OnboardingPage] +class OnboardingRoute extends _i34.PageRouteInfo { + const OnboardingRoute({List<_i34.PageRouteInfo>? children}) : super(OnboardingRoute.name, initialChildren: children); static const String name = 'OnboardingRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return const _i17.OnboardingPage(); + return const _i18.OnboardingPage(); }, ); } /// generated route for -/// [_i18.OrderDetailPage] -class OrderDetailRoute extends _i33.PageRouteInfo { +/// [_i19.OrderDetailPage] +class OrderDetailRoute extends _i34.PageRouteInfo { OrderDetailRoute({ - _i34.Key? key, - required _i19.Order order, - List<_i33.PageRouteInfo>? children, + _i35.Key? key, + required _i20.Order order, + List<_i34.PageRouteInfo>? children, }) : super( OrderDetailRoute.name, args: OrderDetailRouteArgs(key: key, order: order), @@ -405,11 +423,11 @@ class OrderDetailRoute extends _i33.PageRouteInfo { static const String name = 'OrderDetailRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i18.OrderDetailPage(key: args.key, order: args.order); + return _i19.OrderDetailPage(key: args.key, order: args.order); }, ); } @@ -417,9 +435,9 @@ class OrderDetailRoute extends _i33.PageRouteInfo { class OrderDetailRouteArgs { const OrderDetailRouteArgs({this.key, required this.order}); - final _i34.Key? key; + final _i35.Key? key; - final _i19.Order order; + final _i20.Order order; @override String toString() { @@ -428,29 +446,29 @@ class OrderDetailRouteArgs { } /// generated route for -/// [_i19.OrderPage] -class OrderRoute extends _i33.PageRouteInfo { - const OrderRoute({List<_i33.PageRouteInfo>? children}) +/// [_i20.OrderPage] +class OrderRoute extends _i34.PageRouteInfo { + const OrderRoute({List<_i34.PageRouteInfo>? children}) : super(OrderRoute.name, initialChildren: children); static const String name = 'OrderRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return const _i19.OrderPage(); + return const _i20.OrderPage(); }, ); } /// generated route for -/// [_i20.OtpPage] -class OtpRoute extends _i33.PageRouteInfo { +/// [_i21.OtpPage] +class OtpRoute extends _i34.PageRouteInfo { OtpRoute({ - _i34.Key? key, + _i35.Key? key, required String registrationToken, required String phoneNumber, - List<_i33.PageRouteInfo>? children, + List<_i34.PageRouteInfo>? children, }) : super( OtpRoute.name, args: OtpRouteArgs( @@ -463,12 +481,12 @@ class OtpRoute extends _i33.PageRouteInfo { static const String name = 'OtpRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i33.WrappedRoute( - child: _i20.OtpPage( + return _i34.WrappedRoute( + child: _i21.OtpPage( key: args.key, registrationToken: args.registrationToken, phoneNumber: args.phoneNumber, @@ -485,7 +503,7 @@ class OtpRouteArgs { required this.phoneNumber, }); - final _i34.Key? key; + final _i35.Key? key; final String registrationToken; @@ -498,12 +516,12 @@ class OtpRouteArgs { } /// generated route for -/// [_i21.PasswordPage] -class PasswordRoute extends _i33.PageRouteInfo { +/// [_i22.PasswordPage] +class PasswordRoute extends _i34.PageRouteInfo { PasswordRoute({ - _i34.Key? key, + _i35.Key? key, required String phoneNumber, - List<_i33.PageRouteInfo>? children, + List<_i34.PageRouteInfo>? children, }) : super( PasswordRoute.name, args: PasswordRouteArgs(key: key, phoneNumber: phoneNumber), @@ -512,12 +530,12 @@ class PasswordRoute extends _i33.PageRouteInfo { static const String name = 'PasswordRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i33.WrappedRoute( - child: _i21.PasswordPage(key: args.key, phoneNumber: args.phoneNumber), + return _i34.WrappedRoute( + child: _i22.PasswordPage(key: args.key, phoneNumber: args.phoneNumber), ); }, ); @@ -526,7 +544,7 @@ class PasswordRoute extends _i33.PageRouteInfo { class PasswordRouteArgs { const PasswordRouteArgs({this.key, required this.phoneNumber}); - final _i34.Key? key; + final _i35.Key? key; final String phoneNumber; @@ -537,29 +555,29 @@ class PasswordRouteArgs { } /// generated route for -/// [_i22.PaymentPage] -class PaymentRoute extends _i33.PageRouteInfo { - const PaymentRoute({List<_i33.PageRouteInfo>? children}) +/// [_i23.PaymentPage] +class PaymentRoute extends _i34.PageRouteInfo { + const PaymentRoute({List<_i34.PageRouteInfo>? children}) : super(PaymentRoute.name, initialChildren: children); static const String name = 'PaymentRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return const _i22.PaymentPage(); + return const _i23.PaymentPage(); }, ); } /// generated route for -/// [_i23.PinPage] -class PinRoute extends _i33.PageRouteInfo { +/// [_i24.PinPage] +class PinRoute extends _i34.PageRouteInfo { PinRoute({ - _i34.Key? key, + _i35.Key? key, bool isCreatePin = true, String? title, - List<_i33.PageRouteInfo>? children, + List<_i34.PageRouteInfo>? children, }) : super( PinRoute.name, args: PinRouteArgs(key: key, isCreatePin: isCreatePin, title: title), @@ -568,13 +586,13 @@ class PinRoute extends _i33.PageRouteInfo { static const String name = 'PinRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { final args = data.argsAs( orElse: () => const PinRouteArgs(), ); - return _i23.PinPage( + return _i24.PinPage( key: args.key, isCreatePin: args.isCreatePin, title: args.title, @@ -586,7 +604,7 @@ class PinRoute extends _i33.PageRouteInfo { class PinRouteArgs { const PinRouteArgs({this.key, this.isCreatePin = true, this.title}); - final _i34.Key? key; + final _i35.Key? key; final bool isCreatePin; @@ -599,45 +617,45 @@ class PinRouteArgs { } /// generated route for -/// [_i24.PoinHistoryPage] -class PoinHistoryRoute extends _i33.PageRouteInfo { - const PoinHistoryRoute({List<_i33.PageRouteInfo>? children}) +/// [_i25.PoinHistoryPage] +class PoinHistoryRoute extends _i34.PageRouteInfo { + const PoinHistoryRoute({List<_i34.PageRouteInfo>? children}) : super(PoinHistoryRoute.name, initialChildren: children); static const String name = 'PoinHistoryRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return const _i24.PoinHistoryPage(); + return const _i25.PoinHistoryPage(); }, ); } /// generated route for -/// [_i25.PoinPage] -class PoinRoute extends _i33.PageRouteInfo { - const PoinRoute({List<_i33.PageRouteInfo>? children}) +/// [_i26.PoinPage] +class PoinRoute extends _i34.PageRouteInfo { + const PoinRoute({List<_i34.PageRouteInfo>? children}) : super(PoinRoute.name, initialChildren: children); static const String name = 'PoinRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return const _i25.PoinPage(); + return const _i26.PoinPage(); }, ); } /// generated route for -/// [_i26.ProductRedeemPage] -class ProductRedeemRoute extends _i33.PageRouteInfo { +/// [_i27.ProductRedeemPage] +class ProductRedeemRoute extends _i34.PageRouteInfo { ProductRedeemRoute({ - _i34.Key? key, - required _i25.Product product, - required _i25.PointCard pointCard, - List<_i33.PageRouteInfo>? children, + _i35.Key? key, + required _i26.Product product, + required _i26.PointCard pointCard, + List<_i34.PageRouteInfo>? children, }) : super( ProductRedeemRoute.name, args: ProductRedeemRouteArgs( @@ -650,11 +668,11 @@ class ProductRedeemRoute extends _i33.PageRouteInfo { static const String name = 'ProductRedeemRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i26.ProductRedeemPage( + return _i27.ProductRedeemPage( key: args.key, product: args.product, pointCard: args.pointCard, @@ -670,11 +688,11 @@ class ProductRedeemRouteArgs { required this.pointCard, }); - final _i34.Key? key; + final _i35.Key? key; - final _i25.Product product; + final _i26.Product product; - final _i25.PointCard pointCard; + final _i26.PointCard pointCard; @override String toString() { @@ -683,28 +701,28 @@ class ProductRedeemRouteArgs { } /// generated route for -/// [_i27.ProfilePage] -class ProfileRoute extends _i33.PageRouteInfo { - const ProfileRoute({List<_i33.PageRouteInfo>? children}) +/// [_i28.ProfilePage] +class ProfileRoute extends _i34.PageRouteInfo { + const ProfileRoute({List<_i34.PageRouteInfo>? children}) : super(ProfileRoute.name, initialChildren: children); static const String name = 'ProfileRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return _i33.WrappedRoute(child: const _i27.ProfilePage()); + return _i34.WrappedRoute(child: const _i28.ProfilePage()); }, ); } /// generated route for -/// [_i28.RegisterPage] -class RegisterRoute extends _i33.PageRouteInfo { +/// [_i29.RegisterPage] +class RegisterRoute extends _i34.PageRouteInfo { RegisterRoute({ - _i34.Key? key, + _i35.Key? key, required String phoneNumber, - List<_i33.PageRouteInfo>? children, + List<_i34.PageRouteInfo>? children, }) : super( RegisterRoute.name, args: RegisterRouteArgs(key: key, phoneNumber: phoneNumber), @@ -713,12 +731,12 @@ class RegisterRoute extends _i33.PageRouteInfo { static const String name = 'RegisterRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i33.WrappedRoute( - child: _i28.RegisterPage(key: args.key, phoneNumber: args.phoneNumber), + return _i34.WrappedRoute( + child: _i29.RegisterPage(key: args.key, phoneNumber: args.phoneNumber), ); }, ); @@ -727,7 +745,7 @@ class RegisterRoute extends _i33.PageRouteInfo { class RegisterRouteArgs { const RegisterRouteArgs({this.key, required this.phoneNumber}); - final _i34.Key? key; + final _i35.Key? key; final String phoneNumber; @@ -738,65 +756,65 @@ class RegisterRouteArgs { } /// generated route for -/// [_i29.RewardPage] -class RewardRoute extends _i33.PageRouteInfo { - const RewardRoute({List<_i33.PageRouteInfo>? children}) +/// [_i30.RewardPage] +class RewardRoute extends _i34.PageRouteInfo { + const RewardRoute({List<_i34.PageRouteInfo>? children}) : super(RewardRoute.name, initialChildren: children); static const String name = 'RewardRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return const _i29.RewardPage(); + return const _i30.RewardPage(); }, ); } /// generated route for -/// [_i30.SplashPage] -class SplashRoute extends _i33.PageRouteInfo { - const SplashRoute({List<_i33.PageRouteInfo>? children}) +/// [_i31.SplashPage] +class SplashRoute extends _i34.PageRouteInfo { + const SplashRoute({List<_i34.PageRouteInfo>? children}) : super(SplashRoute.name, initialChildren: children); static const String name = 'SplashRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return const _i30.SplashPage(); + return const _i31.SplashPage(); }, ); } /// generated route for -/// [_i31.VoucherDetailPage] -class VoucherDetailRoute extends _i33.PageRouteInfo { - const VoucherDetailRoute({List<_i33.PageRouteInfo>? children}) +/// [_i32.VoucherDetailPage] +class VoucherDetailRoute extends _i34.PageRouteInfo { + const VoucherDetailRoute({List<_i34.PageRouteInfo>? children}) : super(VoucherDetailRoute.name, initialChildren: children); static const String name = 'VoucherDetailRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return const _i31.VoucherDetailPage(); + return const _i32.VoucherDetailPage(); }, ); } /// generated route for -/// [_i32.VoucherPage] -class VoucherRoute extends _i33.PageRouteInfo { - const VoucherRoute({List<_i33.PageRouteInfo>? children}) +/// [_i33.VoucherPage] +class VoucherRoute extends _i34.PageRouteInfo { + const VoucherRoute({List<_i34.PageRouteInfo>? children}) : super(VoucherRoute.name, initialChildren: children); static const String name = 'VoucherRoute'; - static _i33.PageInfo page = _i33.PageInfo( + static _i34.PageInfo page = _i34.PageInfo( name, builder: (data) { - return const _i32.VoucherPage(); + return const _i33.VoucherPage(); }, ); }