feat: product analytic page

This commit is contained in:
efrilm 2025-08-18 16:05:59 +07:00
parent b4d2d859eb
commit 2d25e15380
4 changed files with 881 additions and 96 deletions

View File

@ -57,7 +57,7 @@ class HomeFeature extends StatelessWidget {
title: 'Produk', title: 'Produk',
color: const Color(0xFFFF9800), color: const Color(0xFFFF9800),
icon: LineIcons.box, icon: LineIcons.box,
onTap: () => context.router.push(ProductRoute()), onTap: () => context.router.push(ProductAnalyticRoute()),
), ),
], ],
), ),

View File

@ -0,0 +1,766 @@
import 'package:flutter/material.dart';
import 'package:auto_route/auto_route.dart';
import '../../../../common/theme/theme.dart';
import '../../../../domain/analytic/analytic.dart';
import '../../../components/appbar/appbar.dart';
@RoutePage()
class ProductAnalyticPage extends StatefulWidget {
const ProductAnalyticPage({super.key});
@override
State<ProductAnalyticPage> createState() => _ProductAnalyticPageState();
}
class _ProductAnalyticPageState extends State<ProductAnalyticPage>
with TickerProviderStateMixin {
late AnimationController _animationController;
late AnimationController _cardAnimationController;
late Animation<double> _fadeAnimation;
late Animation<Offset> _slideAnimation;
// Sample data untuk demo
final ProductAnalytic sampleData = ProductAnalytic(
organizationId: "org_123",
outletId: "outlet_456",
dateFrom: "2024-01-01",
dateTo: "2024-01-31",
data: [
ProductAnalyticData(
productId: "prod_1",
productName: "Nasi Goreng Spesial",
categoryId: "cat_1",
categoryName: "Makanan Utama",
quantitySold: 145,
revenue: 2175000.0,
averagePrice: 15000.0,
orderCount: 98,
),
ProductAnalyticData(
productId: "prod_2",
productName: "Es Teh Manis",
categoryId: "cat_2",
categoryName: "Minuman",
quantitySold: 230,
revenue: 1150000.0,
averagePrice: 5000.0,
orderCount: 180,
),
ProductAnalyticData(
productId: "prod_3",
productName: "Ayam Bakar",
categoryId: "cat_1",
categoryName: "Makanan Utama",
quantitySold: 89,
revenue: 2225000.0,
averagePrice: 25000.0,
orderCount: 75,
),
ProductAnalyticData(
productId: "prod_4",
productName: "Cappuccino",
categoryId: "cat_2",
categoryName: "Minuman",
quantitySold: 67,
revenue: 1005000.0,
averagePrice: 15000.0,
orderCount: 52,
),
ProductAnalyticData(
productId: "prod_5",
productName: "Pisang Goreng",
categoryId: "cat_3",
categoryName: "Snack",
quantitySold: 156,
revenue: 780000.0,
averagePrice: 5000.0,
orderCount: 134,
),
],
);
@override
void initState() {
super.initState();
_initializeAnimations();
}
void _initializeAnimations() {
_animationController = AnimationController(
duration: const Duration(milliseconds: 1200),
vsync: this,
);
_cardAnimationController = AnimationController(
duration: const Duration(milliseconds: 800),
vsync: this,
);
_fadeAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _animationController,
curve: const Interval(0.0, 0.6, curve: Curves.easeOut),
),
);
_slideAnimation =
Tween<Offset>(begin: const Offset(0, 0.3), end: Offset.zero).animate(
CurvedAnimation(
parent: _animationController,
curve: const Interval(0.2, 1.0, curve: Curves.easeOutCubic),
),
);
_animationController.forward();
_cardAnimationController.forward();
}
@override
void dispose() {
_animationController.dispose();
_cardAnimationController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColor.background,
body: CustomScrollView(
physics: const BouncingScrollPhysics(),
slivers: [
_buildSliverAppBar(),
_buildSummarySection(),
_buildProductsList(),
],
),
);
}
// SLIVER APP BAR
Widget _buildSliverAppBar() {
return SliverAppBar(
expandedHeight: 120,
floating: false,
pinned: true,
elevation: 0,
backgroundColor: AppColor.primary,
flexibleSpace: FlexibleSpaceBar(
background: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: AppColor.primaryGradient,
),
),
child: const CustomAppBar(title: "Analisis Produk"),
),
),
);
}
// SUMMARY SECTION
Widget _buildSummarySection() {
return SliverToBoxAdapter(
child: FadeTransition(
opacity: _fadeAnimation,
child: SlideTransition(
position: _slideAnimation,
child: Container(
margin: const EdgeInsets.all(16),
child: _buildSummaryCards(sampleData.data),
),
),
),
);
}
// PRODUCTS LIST
Widget _buildProductsList() {
return SliverPadding(
padding: const EdgeInsets.all(16),
sliver: SliverList(
delegate: SliverChildBuilderDelegate((context, index) {
return AnimatedBuilder(
animation: _cardAnimationController,
builder: (context, child) {
final delay = index * 0.1;
final progress = (_cardAnimationController.value - delay).clamp(
0.0,
1.0,
);
final animValue = Curves.easeOutCubic
.transform(progress)
.clamp(0.0, 1.0);
return Transform.translate(
offset: Offset(0, 50 * (1 - animValue)),
child: Opacity(
opacity: animValue,
child: _buildProductCard(sampleData.data[index], index),
),
);
},
);
}, childCount: sampleData.data.length),
),
);
}
// SUMMARY CARDS
Widget _buildSummaryCards(List<ProductAnalyticData> data) {
final stats = _calculateSummaryStats(data);
return Column(
children: [
Row(
children: [
Expanded(
child: _buildSummaryCard(
icon: Icons.monetization_on,
title: 'Total Pendapatan',
value: _formatCurrency(stats.totalRevenue),
color: AppColor.success,
),
),
const SizedBox(width: 12),
Expanded(
child: _buildSummaryCard(
icon: Icons.shopping_cart,
title: 'Total Terjual',
value: _formatNumber(stats.totalQuantity),
color: AppColor.info,
),
),
],
),
const SizedBox(height: 12),
Row(
children: [
Expanded(
child: _buildSummaryCard(
icon: Icons.receipt_long,
title: 'Total Pesanan',
value: _formatNumber(stats.totalOrders),
color: AppColor.warning,
),
),
const SizedBox(width: 12),
Expanded(
child: _buildSummaryCard(
icon: Icons.trending_up,
title: 'Rata-rata Nilai',
value: _formatCurrency(stats.averageOrderValue),
color: AppColor.primary,
),
),
],
),
],
);
}
Widget _buildSummaryCard({
required IconData icon,
required String title,
required String value,
required Color color,
}) {
return TweenAnimationBuilder<double>(
tween: Tween<double>(begin: 0.0, end: 1.0),
duration: const Duration(milliseconds: 800),
curve: Curves.elasticOut,
builder: (context, animationValue, child) {
return Transform.scale(
scale: animationValue,
child: Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: AppColor.surface,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: color.withOpacity(0.1),
blurRadius: 15,
offset: const Offset(0, 5),
),
],
border: Border.all(color: color.withOpacity(0.2), width: 1.5),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [color.withOpacity(0.2), color.withOpacity(0.1)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(12),
),
child: Icon(icon, color: color, size: 24),
),
const SizedBox(height: 16),
Text(
title,
style: _getTextStyle(
AppStyle.md,
color: AppColor.textSecondary,
weight: FontWeight.w500,
),
),
const SizedBox(height: 4),
Text(
value,
style: _getTextStyle(
AppStyle.xxl,
color: color,
weight: FontWeight.bold,
),
),
],
),
),
);
},
);
}
// PRODUCT CARD - NEW CLEAN LAYOUT
Widget _buildProductCard(ProductAnalyticData product, int index) {
return TweenAnimationBuilder<double>(
tween: Tween<double>(begin: 0.0, end: 1.0),
duration: Duration(milliseconds: 600 + (index * 100)),
curve: Curves.easeOutBack,
builder: (context, animationValue, child) {
final clampedValue = animationValue.clamp(0.0, 1.0);
return Transform.translate(
offset: Offset(0, 30 * (1 - clampedValue)),
child: Opacity(
opacity: clampedValue,
child: Container(
margin: EdgeInsets.only(
bottom: index == sampleData.data.length - 1 ? 0 : 16,
),
child: _buildCardContent(product, index),
),
),
);
},
);
}
Widget _buildCardContent(ProductAnalyticData product, int index) {
return Container(
decoration: BoxDecoration(
color: AppColor.white,
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
),
boxShadow: [
BoxShadow(
color: _getCategoryColor(product.categoryName).withOpacity(0.08),
blurRadius: 24,
offset: const Offset(0, 12),
),
BoxShadow(
color: Colors.black.withOpacity(0.04),
blurRadius: 6,
offset: const Offset(0, 2),
),
],
),
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(8),
onTap: () => _onProductTap(product),
child: Column(
children: [
_buildCardHeader(product, index),
_buildCardBody(product),
],
),
),
),
);
}
Widget _buildCardHeader(ProductAnalyticData product, int index) {
return Container(
width: double.infinity,
height: 4,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
_getCategoryColor(product.categoryName),
_getCategoryColor(product.categoryName).withOpacity(0.6),
],
),
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
);
}
Widget _buildCardBody(ProductAnalyticData product) {
final index = sampleData.data.indexOf(product);
return Padding(
padding: const EdgeInsets.all(24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildProductHeader(product, index),
const SizedBox(height: 20),
_buildStatsSection(product),
const SizedBox(height: 16),
_buildAveragePriceSection(product),
],
),
);
}
Widget _buildProductHeader(ProductAnalyticData product, int index) {
return Row(
children: [
_buildCategoryIcon(product.categoryName),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
product.productName,
style: _getTextStyle(AppStyle.lg, weight: FontWeight.bold),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 4),
Text(
product.categoryName,
style: _getTextStyle(
AppStyle.sm,
color: _getCategoryColor(product.categoryName),
weight: FontWeight.w600,
),
),
],
),
),
_buildRankingBadge(index),
],
);
}
Widget _buildCategoryIcon(String categoryName) {
return Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
_getCategoryColor(categoryName).withOpacity(0.1),
_getCategoryColor(categoryName).withOpacity(0.05),
],
),
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: _getCategoryColor(categoryName).withOpacity(0.2),
width: 1.5,
),
),
child: Icon(
_getCategoryIcon(categoryName),
color: _getCategoryColor(categoryName),
size: 28,
),
);
}
Widget _buildRankingBadge(int index) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: _getRankingColor(index),
borderRadius: BorderRadius.circular(12),
),
child: Text(
'#${index + 1}',
style: _getTextStyle(
AppStyle.xs,
color: AppColor.white,
weight: FontWeight.bold,
),
),
);
}
Widget _buildStatsSection(ProductAnalyticData product) {
return Row(
children: [
Expanded(flex: 3, child: _buildRevenueCard(product)),
const SizedBox(width: 12),
Expanded(flex: 2, child: _buildSecondaryStats(product)),
],
);
}
Widget _buildRevenueCard(ProductAnalyticData product) {
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
AppColor.success.withOpacity(0.1),
AppColor.success.withOpacity(0.05),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(16),
border: Border.all(color: AppColor.success.withOpacity(0.2)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(Icons.trending_up, color: AppColor.success, size: 20),
const SizedBox(width: 8),
Text(
'Pendapatan',
style: _getTextStyle(
AppStyle.sm,
color: AppColor.success,
weight: FontWeight.w600,
),
),
],
),
const SizedBox(height: 8),
Text(
_formatCurrency(product.revenue),
style: _getTextStyle(
AppStyle.xl,
color: AppColor.success,
weight: FontWeight.bold,
),
),
],
),
);
}
Widget _buildSecondaryStats(ProductAnalyticData product) {
return Column(
children: [
_buildStatCard(
icon: Icons.shopping_cart_outlined,
value: '${product.quantitySold}',
label: 'Terjual',
color: AppColor.info,
),
const SizedBox(height: 8),
_buildStatCard(
icon: Icons.receipt_outlined,
value: '${product.orderCount}',
label: 'Pesanan',
color: AppColor.warning,
),
],
);
}
Widget _buildStatCard({
required IconData icon,
required String value,
required String label,
required Color color,
}) {
return Container(
width: double.infinity,
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: AppColor.background.withOpacity(0.5),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: AppColor.border.withOpacity(0.1)),
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(icon, color: color, size: 16),
const SizedBox(width: 4),
Text(
value,
style: _getTextStyle(
AppStyle.md,
color: color,
weight: FontWeight.bold,
),
),
],
),
const SizedBox(height: 2),
Text(
label,
style: _getTextStyle(
AppStyle.xs,
color: AppColor.textSecondary,
weight: FontWeight.w500,
),
),
],
),
);
}
Widget _buildAveragePriceSection(ProductAnalyticData product) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
_getCategoryColor(product.categoryName).withOpacity(0.05),
_getCategoryColor(product.categoryName).withOpacity(0.02),
],
),
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Harga Rata-rata',
style: _getTextStyle(
AppStyle.sm,
color: AppColor.textSecondary,
weight: FontWeight.w500,
),
),
Text(
_formatCurrency(product.averagePrice),
style: _getTextStyle(
AppStyle.sm,
color: _getCategoryColor(product.categoryName),
weight: FontWeight.bold,
),
),
],
),
);
}
// HELPER METHODS
SummaryStats _calculateSummaryStats(List<ProductAnalyticData> data) {
final totalRevenue = data.fold<double>(
0,
(sum, item) => sum + item.revenue,
);
final totalQuantity = data.fold<int>(
0,
(sum, item) => sum + item.quantitySold,
);
final totalOrders = data.fold<int>(0, (sum, item) => sum + item.orderCount);
final averageOrderValue = totalOrders > 0 ? totalRevenue / totalOrders : 0;
return SummaryStats(
totalRevenue: totalRevenue,
totalQuantity: totalQuantity,
totalOrders: totalOrders,
averageOrderValue: averageOrderValue.roundToDouble(),
);
}
TextStyle _getTextStyle(
TextStyle? baseStyle, {
Color? color,
FontWeight? weight,
}) {
return baseStyle?.copyWith(color: color, fontWeight: weight) ??
TextStyle(color: color, fontWeight: weight);
}
void _onProductTap(ProductAnalyticData product) {
// Handle product detail navigation
}
Color _getCategoryColor(String categoryName) {
switch (categoryName) {
case 'Makanan Utama':
return AppColor.primary;
case 'Minuman':
return AppColor.info;
case 'Snack':
return AppColor.warning;
default:
return AppColor.secondary;
}
}
Color _getRankingColor(int index) {
switch (index) {
case 0:
return const Color(0xFFFFD700); // Gold
case 1:
return const Color(0xFFC0C0C0); // Silver
case 2:
return const Color(0xFFCD7F32); // Bronze
default:
return AppColor.primary;
}
}
IconData _getCategoryIcon(String categoryName) {
switch (categoryName) {
case 'Makanan Utama':
return Icons.restaurant;
case 'Minuman':
return Icons.local_cafe;
case 'Snack':
return Icons.fastfood;
default:
return Icons.category;
}
}
String _formatCurrency(double amount) {
if (amount >= 1000000) {
return 'Rp ${(amount / 1000000).toStringAsFixed(1)}jt';
} else if (amount >= 1000) {
return 'Rp ${(amount / 1000).toStringAsFixed(0)}rb';
} else {
return 'Rp ${amount.toStringAsFixed(0)}';
}
}
String _formatNumber(int number) {
if (number >= 1000) {
return '${(number / 1000).toStringAsFixed(1)}k';
}
return number.toString();
}
}
// HELPER CLASS
class SummaryStats {
final double totalRevenue;
final int totalQuantity;
final int totalOrders;
final double averageOrderValue;
SummaryStats({
required this.totalRevenue,
required this.totalQuantity,
required this.totalOrders,
required this.averageOrderValue,
});
}

View File

@ -33,6 +33,7 @@ class AppRouter extends RootStackRouter {
// Product // Product
AutoRoute(page: ProductRoute.page), AutoRoute(page: ProductRoute.page),
AutoRoute(page: ProductAnalyticRoute.page),
// Customer // Customer
AutoRoute(page: CustomerRoute.page), AutoRoute(page: CustomerRoute.page),

View File

@ -9,7 +9,7 @@
// coverage:ignore-file // coverage:ignore-file
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:apskel_owner_flutter/domain/order/order.dart' as _i21; import 'package:apskel_owner_flutter/domain/order/order.dart' as _i22;
import 'package:apskel_owner_flutter/presentation/pages/auth/login/login_page.dart' import 'package:apskel_owner_flutter/presentation/pages/auth/login/login_page.dart'
as _i8; as _i8;
import 'package:apskel_owner_flutter/presentation/pages/customer/customer_page.dart' import 'package:apskel_owner_flutter/presentation/pages/customer/customer_page.dart'
@ -32,48 +32,50 @@ import 'package:apskel_owner_flutter/presentation/pages/order/order_detail/order
as _i10; as _i10;
import 'package:apskel_owner_flutter/presentation/pages/order/order_list/order_page.dart' import 'package:apskel_owner_flutter/presentation/pages/order/order_list/order_page.dart'
as _i11; as _i11;
import 'package:apskel_owner_flutter/presentation/pages/product/product_list/product_page.dart' import 'package:apskel_owner_flutter/presentation/pages/product/product_analytic/product_analytic_page.dart'
as _i12; as _i12;
import 'package:apskel_owner_flutter/presentation/pages/profile/profile_page.dart' import 'package:apskel_owner_flutter/presentation/pages/product/product_list/product_page.dart'
as _i13; as _i13;
import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart' import 'package:apskel_owner_flutter/presentation/pages/profile/profile_page.dart'
as _i14; as _i14;
import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart' import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart'
as _i15; as _i15;
import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart' import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart'
as _i16; as _i16;
import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart' import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart'
as _i17; as _i17;
import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart' import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart'
as _i18; as _i18;
import 'package:auto_route/auto_route.dart' as _i19; import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart'
import 'package:flutter/material.dart' as _i20; as _i19;
import 'package:auto_route/auto_route.dart' as _i20;
import 'package:flutter/material.dart' as _i21;
/// generated route for /// generated route for
/// [_i1.CustomerPage] /// [_i1.CustomerPage]
class CustomerRoute extends _i19.PageRouteInfo<void> { class CustomerRoute extends _i20.PageRouteInfo<void> {
const CustomerRoute({List<_i19.PageRouteInfo>? children}) const CustomerRoute({List<_i20.PageRouteInfo>? children})
: super(CustomerRoute.name, initialChildren: children); : super(CustomerRoute.name, initialChildren: children);
static const String name = 'CustomerRoute'; static const String name = 'CustomerRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i19.WrappedRoute(child: const _i1.CustomerPage()); return _i20.WrappedRoute(child: const _i1.CustomerPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i2.DailyTasksFormPage] /// [_i2.DailyTasksFormPage]
class DailyTasksFormRoute extends _i19.PageRouteInfo<void> { class DailyTasksFormRoute extends _i20.PageRouteInfo<void> {
const DailyTasksFormRoute({List<_i19.PageRouteInfo>? children}) const DailyTasksFormRoute({List<_i20.PageRouteInfo>? children})
: super(DailyTasksFormRoute.name, initialChildren: children); : super(DailyTasksFormRoute.name, initialChildren: children);
static const String name = 'DailyTasksFormRoute'; static const String name = 'DailyTasksFormRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i2.DailyTasksFormPage(); return const _i2.DailyTasksFormPage();
@ -83,16 +85,16 @@ class DailyTasksFormRoute extends _i19.PageRouteInfo<void> {
/// generated route for /// generated route for
/// [_i3.ErrorPage] /// [_i3.ErrorPage]
class ErrorRoute extends _i19.PageRouteInfo<ErrorRouteArgs> { class ErrorRoute extends _i20.PageRouteInfo<ErrorRouteArgs> {
ErrorRoute({ ErrorRoute({
_i20.Key? key, _i21.Key? key,
String? title, String? title,
String? message, String? message,
_i20.VoidCallback? onRetry, _i21.VoidCallback? onRetry,
_i20.VoidCallback? onBack, _i21.VoidCallback? onBack,
String? errorCode, String? errorCode,
_i20.IconData? errorIcon, _i21.IconData? errorIcon,
List<_i19.PageRouteInfo>? children, List<_i20.PageRouteInfo>? children,
}) : super( }) : super(
ErrorRoute.name, ErrorRoute.name,
args: ErrorRouteArgs( args: ErrorRouteArgs(
@ -109,7 +111,7 @@ class ErrorRoute extends _i19.PageRouteInfo<ErrorRouteArgs> {
static const String name = 'ErrorRoute'; static const String name = 'ErrorRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
final args = data.argsAs<ErrorRouteArgs>( final args = data.argsAs<ErrorRouteArgs>(
@ -139,19 +141,19 @@ class ErrorRouteArgs {
this.errorIcon, this.errorIcon,
}); });
final _i20.Key? key; final _i21.Key? key;
final String? title; final String? title;
final String? message; final String? message;
final _i20.VoidCallback? onRetry; final _i21.VoidCallback? onRetry;
final _i20.VoidCallback? onBack; final _i21.VoidCallback? onBack;
final String? errorCode; final String? errorCode;
final _i20.IconData? errorIcon; final _i21.IconData? errorIcon;
@override @override
String toString() { String toString() {
@ -161,29 +163,29 @@ class ErrorRouteArgs {
/// generated route for /// generated route for
/// [_i4.FinancePage] /// [_i4.FinancePage]
class FinanceRoute extends _i19.PageRouteInfo<void> { class FinanceRoute extends _i20.PageRouteInfo<void> {
const FinanceRoute({List<_i19.PageRouteInfo>? children}) const FinanceRoute({List<_i20.PageRouteInfo>? children})
: super(FinanceRoute.name, initialChildren: children); : super(FinanceRoute.name, initialChildren: children);
static const String name = 'FinanceRoute'; static const String name = 'FinanceRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i19.WrappedRoute(child: const _i4.FinancePage()); return _i20.WrappedRoute(child: const _i4.FinancePage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i5.HomePage] /// [_i5.HomePage]
class HomeRoute extends _i19.PageRouteInfo<void> { class HomeRoute extends _i20.PageRouteInfo<void> {
const HomeRoute({List<_i19.PageRouteInfo>? children}) const HomeRoute({List<_i20.PageRouteInfo>? children})
: super(HomeRoute.name, initialChildren: children); : super(HomeRoute.name, initialChildren: children);
static const String name = 'HomeRoute'; static const String name = 'HomeRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i5.HomePage(); return const _i5.HomePage();
@ -193,29 +195,29 @@ class HomeRoute extends _i19.PageRouteInfo<void> {
/// generated route for /// generated route for
/// [_i6.InventoryPage] /// [_i6.InventoryPage]
class InventoryRoute extends _i19.PageRouteInfo<void> { class InventoryRoute extends _i20.PageRouteInfo<void> {
const InventoryRoute({List<_i19.PageRouteInfo>? children}) const InventoryRoute({List<_i20.PageRouteInfo>? children})
: super(InventoryRoute.name, initialChildren: children); : super(InventoryRoute.name, initialChildren: children);
static const String name = 'InventoryRoute'; static const String name = 'InventoryRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i19.WrappedRoute(child: const _i6.InventoryPage()); return _i20.WrappedRoute(child: const _i6.InventoryPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i7.LanguagePage] /// [_i7.LanguagePage]
class LanguageRoute extends _i19.PageRouteInfo<void> { class LanguageRoute extends _i20.PageRouteInfo<void> {
const LanguageRoute({List<_i19.PageRouteInfo>? children}) const LanguageRoute({List<_i20.PageRouteInfo>? children})
: super(LanguageRoute.name, initialChildren: children); : super(LanguageRoute.name, initialChildren: children);
static const String name = 'LanguageRoute'; static const String name = 'LanguageRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i7.LanguagePage(); return const _i7.LanguagePage();
@ -225,29 +227,29 @@ class LanguageRoute extends _i19.PageRouteInfo<void> {
/// generated route for /// generated route for
/// [_i8.LoginPage] /// [_i8.LoginPage]
class LoginRoute extends _i19.PageRouteInfo<void> { class LoginRoute extends _i20.PageRouteInfo<void> {
const LoginRoute({List<_i19.PageRouteInfo>? children}) const LoginRoute({List<_i20.PageRouteInfo>? children})
: super(LoginRoute.name, initialChildren: children); : super(LoginRoute.name, initialChildren: children);
static const String name = 'LoginRoute'; static const String name = 'LoginRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i19.WrappedRoute(child: const _i8.LoginPage()); return _i20.WrappedRoute(child: const _i8.LoginPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i9.MainPage] /// [_i9.MainPage]
class MainRoute extends _i19.PageRouteInfo<void> { class MainRoute extends _i20.PageRouteInfo<void> {
const MainRoute({List<_i19.PageRouteInfo>? children}) const MainRoute({List<_i20.PageRouteInfo>? children})
: super(MainRoute.name, initialChildren: children); : super(MainRoute.name, initialChildren: children);
static const String name = 'MainRoute'; static const String name = 'MainRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i9.MainPage(); return const _i9.MainPage();
@ -257,11 +259,11 @@ class MainRoute extends _i19.PageRouteInfo<void> {
/// generated route for /// generated route for
/// [_i10.OrderDetailPage] /// [_i10.OrderDetailPage]
class OrderDetailRoute extends _i19.PageRouteInfo<OrderDetailRouteArgs> { class OrderDetailRoute extends _i20.PageRouteInfo<OrderDetailRouteArgs> {
OrderDetailRoute({ OrderDetailRoute({
_i20.Key? key, _i21.Key? key,
required _i21.Order order, required _i22.Order order,
List<_i19.PageRouteInfo>? children, List<_i20.PageRouteInfo>? children,
}) : super( }) : super(
OrderDetailRoute.name, OrderDetailRoute.name,
args: OrderDetailRouteArgs(key: key, order: order), args: OrderDetailRouteArgs(key: key, order: order),
@ -270,7 +272,7 @@ class OrderDetailRoute extends _i19.PageRouteInfo<OrderDetailRouteArgs> {
static const String name = 'OrderDetailRoute'; static const String name = 'OrderDetailRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
final args = data.argsAs<OrderDetailRouteArgs>(); final args = data.argsAs<OrderDetailRouteArgs>();
@ -282,9 +284,9 @@ class OrderDetailRoute extends _i19.PageRouteInfo<OrderDetailRouteArgs> {
class OrderDetailRouteArgs { class OrderDetailRouteArgs {
const OrderDetailRouteArgs({this.key, required this.order}); const OrderDetailRouteArgs({this.key, required this.order});
final _i20.Key? key; final _i21.Key? key;
final _i21.Order order; final _i22.Order order;
@override @override
String toString() { String toString() {
@ -294,128 +296,144 @@ class OrderDetailRouteArgs {
/// generated route for /// generated route for
/// [_i11.OrderPage] /// [_i11.OrderPage]
class OrderRoute extends _i19.PageRouteInfo<void> { class OrderRoute extends _i20.PageRouteInfo<void> {
const OrderRoute({List<_i19.PageRouteInfo>? children}) const OrderRoute({List<_i20.PageRouteInfo>? children})
: super(OrderRoute.name, initialChildren: children); : super(OrderRoute.name, initialChildren: children);
static const String name = 'OrderRoute'; static const String name = 'OrderRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i19.WrappedRoute(child: const _i11.OrderPage()); return _i20.WrappedRoute(child: const _i11.OrderPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i12.ProductPage] /// [_i12.ProductAnalyticPage]
class ProductRoute extends _i19.PageRouteInfo<void> { class ProductAnalyticRoute extends _i20.PageRouteInfo<void> {
const ProductRoute({List<_i19.PageRouteInfo>? children}) const ProductAnalyticRoute({List<_i20.PageRouteInfo>? children})
: super(ProductAnalyticRoute.name, initialChildren: children);
static const String name = 'ProductAnalyticRoute';
static _i20.PageInfo page = _i20.PageInfo(
name,
builder: (data) {
return const _i12.ProductAnalyticPage();
},
);
}
/// generated route for
/// [_i13.ProductPage]
class ProductRoute extends _i20.PageRouteInfo<void> {
const ProductRoute({List<_i20.PageRouteInfo>? children})
: super(ProductRoute.name, initialChildren: children); : super(ProductRoute.name, initialChildren: children);
static const String name = 'ProductRoute'; static const String name = 'ProductRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i19.WrappedRoute(child: const _i12.ProductPage()); return _i20.WrappedRoute(child: const _i13.ProductPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i13.ProfilePage] /// [_i14.ProfilePage]
class ProfileRoute extends _i19.PageRouteInfo<void> { class ProfileRoute extends _i20.PageRouteInfo<void> {
const ProfileRoute({List<_i19.PageRouteInfo>? children}) const ProfileRoute({List<_i20.PageRouteInfo>? children})
: super(ProfileRoute.name, initialChildren: children); : super(ProfileRoute.name, initialChildren: children);
static const String name = 'ProfileRoute'; static const String name = 'ProfileRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i19.WrappedRoute(child: const _i13.ProfilePage()); return _i20.WrappedRoute(child: const _i14.ProfilePage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i14.PurchasePage] /// [_i15.PurchasePage]
class PurchaseRoute extends _i19.PageRouteInfo<void> { class PurchaseRoute extends _i20.PageRouteInfo<void> {
const PurchaseRoute({List<_i19.PageRouteInfo>? children}) const PurchaseRoute({List<_i20.PageRouteInfo>? children})
: super(PurchaseRoute.name, initialChildren: children); : super(PurchaseRoute.name, initialChildren: children);
static const String name = 'PurchaseRoute'; static const String name = 'PurchaseRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i14.PurchasePage(); return const _i15.PurchasePage();
}, },
); );
} }
/// generated route for /// generated route for
/// [_i15.ReportPage] /// [_i16.ReportPage]
class ReportRoute extends _i19.PageRouteInfo<void> { class ReportRoute extends _i20.PageRouteInfo<void> {
const ReportRoute({List<_i19.PageRouteInfo>? children}) const ReportRoute({List<_i20.PageRouteInfo>? children})
: super(ReportRoute.name, initialChildren: children); : super(ReportRoute.name, initialChildren: children);
static const String name = 'ReportRoute'; static const String name = 'ReportRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i19.WrappedRoute(child: const _i15.ReportPage()); return _i20.WrappedRoute(child: const _i16.ReportPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i16.SalesPage] /// [_i17.SalesPage]
class SalesRoute extends _i19.PageRouteInfo<void> { class SalesRoute extends _i20.PageRouteInfo<void> {
const SalesRoute({List<_i19.PageRouteInfo>? children}) const SalesRoute({List<_i20.PageRouteInfo>? children})
: super(SalesRoute.name, initialChildren: children); : super(SalesRoute.name, initialChildren: children);
static const String name = 'SalesRoute'; static const String name = 'SalesRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i19.WrappedRoute(child: const _i16.SalesPage()); return _i20.WrappedRoute(child: const _i17.SalesPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i17.SchedulePage] /// [_i18.SchedulePage]
class ScheduleRoute extends _i19.PageRouteInfo<void> { class ScheduleRoute extends _i20.PageRouteInfo<void> {
const ScheduleRoute({List<_i19.PageRouteInfo>? children}) const ScheduleRoute({List<_i20.PageRouteInfo>? children})
: super(ScheduleRoute.name, initialChildren: children); : super(ScheduleRoute.name, initialChildren: children);
static const String name = 'ScheduleRoute'; static const String name = 'ScheduleRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i17.SchedulePage(); return const _i18.SchedulePage();
}, },
); );
} }
/// generated route for /// generated route for
/// [_i18.SplashPage] /// [_i19.SplashPage]
class SplashRoute extends _i19.PageRouteInfo<void> { class SplashRoute extends _i20.PageRouteInfo<void> {
const SplashRoute({List<_i19.PageRouteInfo>? children}) const SplashRoute({List<_i20.PageRouteInfo>? children})
: super(SplashRoute.name, initialChildren: children); : super(SplashRoute.name, initialChildren: children);
static const String name = 'SplashRoute'; static const String name = 'SplashRoute';
static _i19.PageInfo page = _i19.PageInfo( static _i20.PageInfo page = _i20.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i18.SplashPage(); return const _i19.SplashPage();
}, },
); );
} }