feat: order detail

This commit is contained in:
efrilm 2025-08-18 15:30:34 +07:00
parent c367bd2cd9
commit b4d2d859eb
4 changed files with 1366 additions and 90 deletions

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@ import '../../../components/appbar/appbar.dart';
import '../../../components/button/button.dart'; import '../../../components/button/button.dart';
import '../../../components/spacer/spacer.dart'; import '../../../components/spacer/spacer.dart';
import '../../../components/widgets/empty_widget.dart'; import '../../../components/widgets/empty_widget.dart';
import '../../../router/app_router.gr.dart';
import 'widgets/status_tile.dart'; import 'widgets/status_tile.dart';
import 'widgets/order_tile.dart'; import 'widgets/order_tile.dart';
@ -219,7 +220,11 @@ class _OrderPageState extends State<OrderPage> with TickerProviderStateMixin {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return OrderTile( return OrderTile(
onTap: () {}, onTap: () => context.router.push(
OrderDetailRoute(
order: state.orders[index],
),
),
order: state.orders[index], order: state.orders[index],
); );
}, },

View File

@ -51,5 +51,8 @@ class AppRouter extends RootStackRouter {
// Error // Error
AutoRoute(page: ErrorRoute.page), AutoRoute(page: ErrorRoute.page),
// Order
AutoRoute(page: OrderDetailRoute.page),
]; ];
} }

View File

@ -9,6 +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/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'
@ -27,50 +28,52 @@ import 'package:apskel_owner_flutter/presentation/pages/language/language_page.d
as _i7; as _i7;
import 'package:apskel_owner_flutter/presentation/pages/main/main_page.dart' import 'package:apskel_owner_flutter/presentation/pages/main/main_page.dart'
as _i9; as _i9;
import 'package:apskel_owner_flutter/presentation/pages/order/order_list/order_page.dart' import 'package:apskel_owner_flutter/presentation/pages/order/order_detail/order_detail_page.dart'
as _i10; as _i10;
import 'package:apskel_owner_flutter/presentation/pages/product/product_list/product_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/profile/profile_page.dart' import 'package:apskel_owner_flutter/presentation/pages/product/product_list/product_page.dart'
as _i12; as _i12;
import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart' import 'package:apskel_owner_flutter/presentation/pages/profile/profile_page.dart'
as _i13; as _i13;
import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart' import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart'
as _i14; as _i14;
import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart' import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart'
as _i15; as _i15;
import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart' import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart'
as _i16; as _i16;
import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart' import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart'
as _i17; as _i17;
import 'package:auto_route/auto_route.dart' as _i18; import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart'
import 'package:flutter/material.dart' as _i19; as _i18;
import 'package:auto_route/auto_route.dart' as _i19;
import 'package:flutter/material.dart' as _i20;
/// generated route for /// generated route for
/// [_i1.CustomerPage] /// [_i1.CustomerPage]
class CustomerRoute extends _i18.PageRouteInfo<void> { class CustomerRoute extends _i19.PageRouteInfo<void> {
const CustomerRoute({List<_i18.PageRouteInfo>? children}) const CustomerRoute({List<_i19.PageRouteInfo>? children})
: super(CustomerRoute.name, initialChildren: children); : super(CustomerRoute.name, initialChildren: children);
static const String name = 'CustomerRoute'; static const String name = 'CustomerRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i1.CustomerPage()); return _i19.WrappedRoute(child: const _i1.CustomerPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i2.DailyTasksFormPage] /// [_i2.DailyTasksFormPage]
class DailyTasksFormRoute extends _i18.PageRouteInfo<void> { class DailyTasksFormRoute extends _i19.PageRouteInfo<void> {
const DailyTasksFormRoute({List<_i18.PageRouteInfo>? children}) const DailyTasksFormRoute({List<_i19.PageRouteInfo>? children})
: super(DailyTasksFormRoute.name, initialChildren: children); : super(DailyTasksFormRoute.name, initialChildren: children);
static const String name = 'DailyTasksFormRoute'; static const String name = 'DailyTasksFormRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i2.DailyTasksFormPage(); return const _i2.DailyTasksFormPage();
@ -80,16 +83,16 @@ class DailyTasksFormRoute extends _i18.PageRouteInfo<void> {
/// generated route for /// generated route for
/// [_i3.ErrorPage] /// [_i3.ErrorPage]
class ErrorRoute extends _i18.PageRouteInfo<ErrorRouteArgs> { class ErrorRoute extends _i19.PageRouteInfo<ErrorRouteArgs> {
ErrorRoute({ ErrorRoute({
_i19.Key? key, _i20.Key? key,
String? title, String? title,
String? message, String? message,
_i19.VoidCallback? onRetry, _i20.VoidCallback? onRetry,
_i19.VoidCallback? onBack, _i20.VoidCallback? onBack,
String? errorCode, String? errorCode,
_i19.IconData? errorIcon, _i20.IconData? errorIcon,
List<_i18.PageRouteInfo>? children, List<_i19.PageRouteInfo>? children,
}) : super( }) : super(
ErrorRoute.name, ErrorRoute.name,
args: ErrorRouteArgs( args: ErrorRouteArgs(
@ -106,7 +109,7 @@ class ErrorRoute extends _i18.PageRouteInfo<ErrorRouteArgs> {
static const String name = 'ErrorRoute'; static const String name = 'ErrorRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
final args = data.argsAs<ErrorRouteArgs>( final args = data.argsAs<ErrorRouteArgs>(
@ -136,19 +139,19 @@ class ErrorRouteArgs {
this.errorIcon, this.errorIcon,
}); });
final _i19.Key? key; final _i20.Key? key;
final String? title; final String? title;
final String? message; final String? message;
final _i19.VoidCallback? onRetry; final _i20.VoidCallback? onRetry;
final _i19.VoidCallback? onBack; final _i20.VoidCallback? onBack;
final String? errorCode; final String? errorCode;
final _i19.IconData? errorIcon; final _i20.IconData? errorIcon;
@override @override
String toString() { String toString() {
@ -158,29 +161,29 @@ class ErrorRouteArgs {
/// generated route for /// generated route for
/// [_i4.FinancePage] /// [_i4.FinancePage]
class FinanceRoute extends _i18.PageRouteInfo<void> { class FinanceRoute extends _i19.PageRouteInfo<void> {
const FinanceRoute({List<_i18.PageRouteInfo>? children}) const FinanceRoute({List<_i19.PageRouteInfo>? children})
: super(FinanceRoute.name, initialChildren: children); : super(FinanceRoute.name, initialChildren: children);
static const String name = 'FinanceRoute'; static const String name = 'FinanceRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i4.FinancePage()); return _i19.WrappedRoute(child: const _i4.FinancePage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i5.HomePage] /// [_i5.HomePage]
class HomeRoute extends _i18.PageRouteInfo<void> { class HomeRoute extends _i19.PageRouteInfo<void> {
const HomeRoute({List<_i18.PageRouteInfo>? children}) const HomeRoute({List<_i19.PageRouteInfo>? children})
: super(HomeRoute.name, initialChildren: children); : super(HomeRoute.name, initialChildren: children);
static const String name = 'HomeRoute'; static const String name = 'HomeRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i5.HomePage(); return const _i5.HomePage();
@ -190,29 +193,29 @@ class HomeRoute extends _i18.PageRouteInfo<void> {
/// generated route for /// generated route for
/// [_i6.InventoryPage] /// [_i6.InventoryPage]
class InventoryRoute extends _i18.PageRouteInfo<void> { class InventoryRoute extends _i19.PageRouteInfo<void> {
const InventoryRoute({List<_i18.PageRouteInfo>? children}) const InventoryRoute({List<_i19.PageRouteInfo>? children})
: super(InventoryRoute.name, initialChildren: children); : super(InventoryRoute.name, initialChildren: children);
static const String name = 'InventoryRoute'; static const String name = 'InventoryRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i6.InventoryPage()); return _i19.WrappedRoute(child: const _i6.InventoryPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i7.LanguagePage] /// [_i7.LanguagePage]
class LanguageRoute extends _i18.PageRouteInfo<void> { class LanguageRoute extends _i19.PageRouteInfo<void> {
const LanguageRoute({List<_i18.PageRouteInfo>? children}) const LanguageRoute({List<_i19.PageRouteInfo>? children})
: super(LanguageRoute.name, initialChildren: children); : super(LanguageRoute.name, initialChildren: children);
static const String name = 'LanguageRoute'; static const String name = 'LanguageRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i7.LanguagePage(); return const _i7.LanguagePage();
@ -222,29 +225,29 @@ class LanguageRoute extends _i18.PageRouteInfo<void> {
/// generated route for /// generated route for
/// [_i8.LoginPage] /// [_i8.LoginPage]
class LoginRoute extends _i18.PageRouteInfo<void> { class LoginRoute extends _i19.PageRouteInfo<void> {
const LoginRoute({List<_i18.PageRouteInfo>? children}) const LoginRoute({List<_i19.PageRouteInfo>? children})
: super(LoginRoute.name, initialChildren: children); : super(LoginRoute.name, initialChildren: children);
static const String name = 'LoginRoute'; static const String name = 'LoginRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i8.LoginPage()); return _i19.WrappedRoute(child: const _i8.LoginPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i9.MainPage] /// [_i9.MainPage]
class MainRoute extends _i18.PageRouteInfo<void> { class MainRoute extends _i19.PageRouteInfo<void> {
const MainRoute({List<_i18.PageRouteInfo>? children}) const MainRoute({List<_i19.PageRouteInfo>? children})
: super(MainRoute.name, initialChildren: children); : super(MainRoute.name, initialChildren: children);
static const String name = 'MainRoute'; static const String name = 'MainRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i9.MainPage(); return const _i9.MainPage();
@ -253,129 +256,166 @@ class MainRoute extends _i18.PageRouteInfo<void> {
} }
/// generated route for /// generated route for
/// [_i10.OrderPage] /// [_i10.OrderDetailPage]
class OrderRoute extends _i18.PageRouteInfo<void> { class OrderDetailRoute extends _i19.PageRouteInfo<OrderDetailRouteArgs> {
const OrderRoute({List<_i18.PageRouteInfo>? children}) OrderDetailRoute({
_i20.Key? key,
required _i21.Order order,
List<_i19.PageRouteInfo>? children,
}) : super(
OrderDetailRoute.name,
args: OrderDetailRouteArgs(key: key, order: order),
initialChildren: children,
);
static const String name = 'OrderDetailRoute';
static _i19.PageInfo page = _i19.PageInfo(
name,
builder: (data) {
final args = data.argsAs<OrderDetailRouteArgs>();
return _i10.OrderDetailPage(key: args.key, order: args.order);
},
);
}
class OrderDetailRouteArgs {
const OrderDetailRouteArgs({this.key, required this.order});
final _i20.Key? key;
final _i21.Order order;
@override
String toString() {
return 'OrderDetailRouteArgs{key: $key, order: $order}';
}
}
/// generated route for
/// [_i11.OrderPage]
class OrderRoute extends _i19.PageRouteInfo<void> {
const OrderRoute({List<_i19.PageRouteInfo>? children})
: super(OrderRoute.name, initialChildren: children); : super(OrderRoute.name, initialChildren: children);
static const String name = 'OrderRoute'; static const String name = 'OrderRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i10.OrderPage()); return _i19.WrappedRoute(child: const _i11.OrderPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i11.ProductPage] /// [_i12.ProductPage]
class ProductRoute extends _i18.PageRouteInfo<void> { class ProductRoute extends _i19.PageRouteInfo<void> {
const ProductRoute({List<_i18.PageRouteInfo>? children}) const ProductRoute({List<_i19.PageRouteInfo>? children})
: super(ProductRoute.name, initialChildren: children); : super(ProductRoute.name, initialChildren: children);
static const String name = 'ProductRoute'; static const String name = 'ProductRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i11.ProductPage()); return _i19.WrappedRoute(child: const _i12.ProductPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i12.ProfilePage] /// [_i13.ProfilePage]
class ProfileRoute extends _i18.PageRouteInfo<void> { class ProfileRoute extends _i19.PageRouteInfo<void> {
const ProfileRoute({List<_i18.PageRouteInfo>? children}) const ProfileRoute({List<_i19.PageRouteInfo>? children})
: super(ProfileRoute.name, initialChildren: children); : super(ProfileRoute.name, initialChildren: children);
static const String name = 'ProfileRoute'; static const String name = 'ProfileRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i12.ProfilePage()); return _i19.WrappedRoute(child: const _i13.ProfilePage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i13.PurchasePage] /// [_i14.PurchasePage]
class PurchaseRoute extends _i18.PageRouteInfo<void> { class PurchaseRoute extends _i19.PageRouteInfo<void> {
const PurchaseRoute({List<_i18.PageRouteInfo>? children}) const PurchaseRoute({List<_i19.PageRouteInfo>? children})
: super(PurchaseRoute.name, initialChildren: children); : super(PurchaseRoute.name, initialChildren: children);
static const String name = 'PurchaseRoute'; static const String name = 'PurchaseRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i13.PurchasePage(); return const _i14.PurchasePage();
}, },
); );
} }
/// generated route for /// generated route for
/// [_i14.ReportPage] /// [_i15.ReportPage]
class ReportRoute extends _i18.PageRouteInfo<void> { class ReportRoute extends _i19.PageRouteInfo<void> {
const ReportRoute({List<_i18.PageRouteInfo>? children}) const ReportRoute({List<_i19.PageRouteInfo>? children})
: super(ReportRoute.name, initialChildren: children); : super(ReportRoute.name, initialChildren: children);
static const String name = 'ReportRoute'; static const String name = 'ReportRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i14.ReportPage()); return _i19.WrappedRoute(child: const _i15.ReportPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i15.SalesPage] /// [_i16.SalesPage]
class SalesRoute extends _i18.PageRouteInfo<void> { class SalesRoute extends _i19.PageRouteInfo<void> {
const SalesRoute({List<_i18.PageRouteInfo>? children}) const SalesRoute({List<_i19.PageRouteInfo>? children})
: super(SalesRoute.name, initialChildren: children); : super(SalesRoute.name, initialChildren: children);
static const String name = 'SalesRoute'; static const String name = 'SalesRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i15.SalesPage()); return _i19.WrappedRoute(child: const _i16.SalesPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i16.SchedulePage] /// [_i17.SchedulePage]
class ScheduleRoute extends _i18.PageRouteInfo<void> { class ScheduleRoute extends _i19.PageRouteInfo<void> {
const ScheduleRoute({List<_i18.PageRouteInfo>? children}) const ScheduleRoute({List<_i19.PageRouteInfo>? children})
: super(ScheduleRoute.name, initialChildren: children); : super(ScheduleRoute.name, initialChildren: children);
static const String name = 'ScheduleRoute'; static const String name = 'ScheduleRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i16.SchedulePage(); return const _i17.SchedulePage();
}, },
); );
} }
/// generated route for /// generated route for
/// [_i17.SplashPage] /// [_i18.SplashPage]
class SplashRoute extends _i18.PageRouteInfo<void> { class SplashRoute extends _i19.PageRouteInfo<void> {
const SplashRoute({List<_i18.PageRouteInfo>? children}) const SplashRoute({List<_i19.PageRouteInfo>? children})
: super(SplashRoute.name, initialChildren: children); : super(SplashRoute.name, initialChildren: children);
static const String name = 'SplashRoute'; static const String name = 'SplashRoute';
static _i18.PageInfo page = _i18.PageInfo( static _i19.PageInfo page = _i19.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i17.SplashPage(); return const _i18.SplashPage();
}, },
); );
} }