feat: change name transaction to order

This commit is contained in:
efrilm 2025-08-18 13:33:45 +07:00
parent b8055c8eab
commit 62eb15b27f
8 changed files with 54 additions and 152 deletions

View File

@ -11,7 +11,7 @@ class MainPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AutoTabsRouter.pageView( return AutoTabsRouter.pageView(
routes: [HomeRoute(), TransactionRoute(), ReportRoute(), ProfileRoute()], routes: [HomeRoute(), OrderRoute(), ReportRoute(), ProfileRoute()],
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
builder: (context, child, pageController) { builder: (context, child, pageController) {
final tabsRouter = AutoTabsRouter.of(context); final tabsRouter = AutoTabsRouter.of(context);

View File

@ -33,8 +33,8 @@ class _MainBottomNavbarState extends State<MainBottomNavbar> {
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: LineIcon(LineIcons.moneyBill), icon: LineIcon(LineIcons.moneyBill),
label: context.lang.transaction, label: 'Order',
tooltip: context.lang.transaction, tooltip: 'Order',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: LineIcon(LineIcons.barChart), icon: LineIcon(LineIcons.barChart),

View File

@ -7,18 +7,17 @@ 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 'widgets/status_tile.dart'; import 'widgets/status_tile.dart';
import 'widgets/transaction_tile.dart'; import 'widgets/order_tile.dart';
@RoutePage() @RoutePage()
class TransactionPage extends StatefulWidget { class OrderPage extends StatefulWidget {
const TransactionPage({super.key}); const OrderPage({super.key});
@override @override
State<TransactionPage> createState() => _TransactionPageState(); State<OrderPage> createState() => _OrderPageState();
} }
class _TransactionPageState extends State<TransactionPage> class _OrderPageState extends State<OrderPage> with TickerProviderStateMixin {
with TickerProviderStateMixin {
late AnimationController _fadeController; late AnimationController _fadeController;
late AnimationController _slideController; late AnimationController _slideController;
late Animation<double> _fadeAnimation; late Animation<double> _fadeAnimation;
@ -139,7 +138,7 @@ class _TransactionPageState extends State<TransactionPage>
pinned: true, pinned: true,
backgroundColor: AppColor.primary, backgroundColor: AppColor.primary,
centerTitle: false, centerTitle: false,
flexibleSpace: CustomAppBar(title: 'Transaction', isBack: false), flexibleSpace: CustomAppBar(title: 'Order', isBack: false),
actions: [ actions: [
ActionIconButton(onTap: () {}, icon: LineIcons.filter), ActionIconButton(onTap: () {}, icon: LineIcons.filter),
SpaceWidth(8), SpaceWidth(8),
@ -170,7 +169,7 @@ class _TransactionPageState extends State<TransactionPage>
padding: EdgeInsets.only( padding: EdgeInsets.only(
right: index < filterOptions.length - 1 ? 8 : 0, right: index < filterOptions.length - 1 ? 8 : 0,
), ),
child: TransactionStatusTile( child: OrderStatusTile(
label: option, label: option,
isSelected: option == selectedFilter, isSelected: option == selectedFilter,
onSelected: (isSelected) { onSelected: (isSelected) {
@ -249,7 +248,7 @@ class _TransactionPageState extends State<TransactionPage>
children: filteredTransactions.map(( children: filteredTransactions.map((
transaction, transaction,
) { ) {
return TransactionTile( return OrderTile(
transaction: transaction, transaction: transaction,
onTap: () {}, onTap: () {},
); );

View File

@ -28,13 +28,13 @@ class Transaction {
enum TransactionStatus { completed, pending, cancelled, refunded } enum TransactionStatus { completed, pending, cancelled, refunded }
class TransactionTile extends StatelessWidget { class OrderTile extends StatelessWidget {
final Transaction transaction; final Transaction transaction;
final VoidCallback? onTap; final VoidCallback? onTap;
final VoidCallback? onPrint; final VoidCallback? onPrint;
final VoidCallback? onRefund; final VoidCallback? onRefund;
const TransactionTile({ const OrderTile({
super.key, super.key,
required this.transaction, required this.transaction,
this.onTap, this.onTap,

View File

@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
import '../../../../common/theme/theme.dart'; import '../../../../common/theme/theme.dart';
class TransactionStatusTile extends StatelessWidget { class OrderStatusTile extends StatelessWidget {
final String label; final String label;
final bool isSelected; final bool isSelected;
final void Function(bool)? onSelected; final void Function(bool)? onSelected;
const TransactionStatusTile({ const OrderStatusTile({
super.key, super.key,
required this.label, required this.label,
this.isSelected = false, this.isSelected = false,

View File

@ -1,97 +0,0 @@
import 'package:flutter/material.dart';
import '../../../../common/theme/theme.dart';
class TransactionAppBar extends StatelessWidget {
final Animation<double> rotationAnimation;
const TransactionAppBar({super.key, required this.rotationAnimation});
@override
Widget build(BuildContext context) {
return FlexibleSpaceBar(
titlePadding: const EdgeInsets.only(left: 20, bottom: 16),
title: Text(
'Transaksi',
style: AppStyle.xl.copyWith(
color: AppColor.textWhite,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
background: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: AppColor.primaryGradient,
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Stack(
children: [
Positioned(
right: -20,
top: -20,
child: AnimatedBuilder(
animation: rotationAnimation,
builder: (context, child) {
return Transform.rotate(
angle: rotationAnimation.value,
child: Container(
width: 100,
height: 100,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppColor.white.withOpacity(0.1),
),
),
);
},
),
),
Positioned(
left: -30,
bottom: -30,
child: AnimatedBuilder(
animation: rotationAnimation,
builder: (context, child) {
return Transform.rotate(
angle: -rotationAnimation.value * 0.5,
child: Container(
width: 80,
height: 80,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppColor.white.withOpacity(0.05),
),
),
);
},
),
),
Positioned(
right: 80,
bottom: 30,
child: AnimatedBuilder(
animation: rotationAnimation,
builder: (context, child) {
return Transform.rotate(
angle: -rotationAnimation.value * 0.2,
child: Container(
width: 40,
height: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: AppColor.white.withOpacity(0.08),
),
),
);
},
),
),
],
),
),
);
}
}

View File

@ -16,7 +16,7 @@ class AppRouter extends RootStackRouter {
page: MainRoute.page, page: MainRoute.page,
children: [ children: [
AutoRoute(page: HomeRoute.page), AutoRoute(page: HomeRoute.page),
AutoRoute(page: TransactionRoute.page), AutoRoute(page: OrderRoute.page),
AutoRoute(page: ReportRoute.page), AutoRoute(page: ReportRoute.page),
AutoRoute(page: ProfileRoute.page), AutoRoute(page: ProfileRoute.page),
], ],

View File

@ -27,21 +27,21 @@ 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/product/product_list/product_page.dart' import 'package:apskel_owner_flutter/presentation/pages/order/order_page.dart'
as _i10; as _i10;
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 _i11; as _i11;
import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart' import 'package:apskel_owner_flutter/presentation/pages/profile/profile_page.dart'
as _i12; as _i12;
import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart' import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart'
as _i13; as _i13;
import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart' import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart'
as _i14; as _i14;
import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart' import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart'
as _i15; as _i15;
import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart' import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart'
as _i16; as _i16;
import 'package:apskel_owner_flutter/presentation/pages/transaction/transaction_page.dart' import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart'
as _i17; as _i17;
import 'package:auto_route/auto_route.dart' as _i18; import 'package:auto_route/auto_route.dart' as _i18;
import 'package:flutter/material.dart' as _i19; import 'package:flutter/material.dart' as _i19;
@ -253,7 +253,23 @@ class MainRoute extends _i18.PageRouteInfo<void> {
} }
/// generated route for /// generated route for
/// [_i10.ProductPage] /// [_i10.OrderPage]
class OrderRoute extends _i18.PageRouteInfo<void> {
const OrderRoute({List<_i18.PageRouteInfo>? children})
: super(OrderRoute.name, initialChildren: children);
static const String name = 'OrderRoute';
static _i18.PageInfo page = _i18.PageInfo(
name,
builder: (data) {
return const _i10.OrderPage();
},
);
}
/// generated route for
/// [_i11.ProductPage]
class ProductRoute extends _i18.PageRouteInfo<void> { class ProductRoute extends _i18.PageRouteInfo<void> {
const ProductRoute({List<_i18.PageRouteInfo>? children}) const ProductRoute({List<_i18.PageRouteInfo>? children})
: super(ProductRoute.name, initialChildren: children); : super(ProductRoute.name, initialChildren: children);
@ -263,13 +279,13 @@ class ProductRoute extends _i18.PageRouteInfo<void> {
static _i18.PageInfo page = _i18.PageInfo( static _i18.PageInfo page = _i18.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i10.ProductPage()); return _i18.WrappedRoute(child: const _i11.ProductPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i11.ProfilePage] /// [_i12.ProfilePage]
class ProfileRoute extends _i18.PageRouteInfo<void> { class ProfileRoute extends _i18.PageRouteInfo<void> {
const ProfileRoute({List<_i18.PageRouteInfo>? children}) const ProfileRoute({List<_i18.PageRouteInfo>? children})
: super(ProfileRoute.name, initialChildren: children); : super(ProfileRoute.name, initialChildren: children);
@ -279,13 +295,13 @@ class ProfileRoute extends _i18.PageRouteInfo<void> {
static _i18.PageInfo page = _i18.PageInfo( static _i18.PageInfo page = _i18.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i11.ProfilePage()); return _i18.WrappedRoute(child: const _i12.ProfilePage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i12.PurchasePage] /// [_i13.PurchasePage]
class PurchaseRoute extends _i18.PageRouteInfo<void> { class PurchaseRoute extends _i18.PageRouteInfo<void> {
const PurchaseRoute({List<_i18.PageRouteInfo>? children}) const PurchaseRoute({List<_i18.PageRouteInfo>? children})
: super(PurchaseRoute.name, initialChildren: children); : super(PurchaseRoute.name, initialChildren: children);
@ -295,13 +311,13 @@ class PurchaseRoute extends _i18.PageRouteInfo<void> {
static _i18.PageInfo page = _i18.PageInfo( static _i18.PageInfo page = _i18.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i12.PurchasePage(); return const _i13.PurchasePage();
}, },
); );
} }
/// generated route for /// generated route for
/// [_i13.ReportPage] /// [_i14.ReportPage]
class ReportRoute extends _i18.PageRouteInfo<void> { class ReportRoute extends _i18.PageRouteInfo<void> {
const ReportRoute({List<_i18.PageRouteInfo>? children}) const ReportRoute({List<_i18.PageRouteInfo>? children})
: super(ReportRoute.name, initialChildren: children); : super(ReportRoute.name, initialChildren: children);
@ -311,13 +327,13 @@ class ReportRoute extends _i18.PageRouteInfo<void> {
static _i18.PageInfo page = _i18.PageInfo( static _i18.PageInfo page = _i18.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i13.ReportPage()); return _i18.WrappedRoute(child: const _i14.ReportPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i14.SalesPage] /// [_i15.SalesPage]
class SalesRoute extends _i18.PageRouteInfo<void> { class SalesRoute extends _i18.PageRouteInfo<void> {
const SalesRoute({List<_i18.PageRouteInfo>? children}) const SalesRoute({List<_i18.PageRouteInfo>? children})
: super(SalesRoute.name, initialChildren: children); : super(SalesRoute.name, initialChildren: children);
@ -327,13 +343,13 @@ class SalesRoute extends _i18.PageRouteInfo<void> {
static _i18.PageInfo page = _i18.PageInfo( static _i18.PageInfo page = _i18.PageInfo(
name, name,
builder: (data) { builder: (data) {
return _i18.WrappedRoute(child: const _i14.SalesPage()); return _i18.WrappedRoute(child: const _i15.SalesPage());
}, },
); );
} }
/// generated route for /// generated route for
/// [_i15.SchedulePage] /// [_i16.SchedulePage]
class ScheduleRoute extends _i18.PageRouteInfo<void> { class ScheduleRoute extends _i18.PageRouteInfo<void> {
const ScheduleRoute({List<_i18.PageRouteInfo>? children}) const ScheduleRoute({List<_i18.PageRouteInfo>? children})
: super(ScheduleRoute.name, initialChildren: children); : super(ScheduleRoute.name, initialChildren: children);
@ -343,13 +359,13 @@ class ScheduleRoute extends _i18.PageRouteInfo<void> {
static _i18.PageInfo page = _i18.PageInfo( static _i18.PageInfo page = _i18.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i15.SchedulePage(); return const _i16.SchedulePage();
}, },
); );
} }
/// generated route for /// generated route for
/// [_i16.SplashPage] /// [_i17.SplashPage]
class SplashRoute extends _i18.PageRouteInfo<void> { class SplashRoute extends _i18.PageRouteInfo<void> {
const SplashRoute({List<_i18.PageRouteInfo>? children}) const SplashRoute({List<_i18.PageRouteInfo>? children})
: super(SplashRoute.name, initialChildren: children); : super(SplashRoute.name, initialChildren: children);
@ -359,23 +375,7 @@ class SplashRoute extends _i18.PageRouteInfo<void> {
static _i18.PageInfo page = _i18.PageInfo( static _i18.PageInfo page = _i18.PageInfo(
name, name,
builder: (data) { builder: (data) {
return const _i16.SplashPage(); return const _i17.SplashPage();
},
);
}
/// generated route for
/// [_i17.TransactionPage]
class TransactionRoute extends _i18.PageRouteInfo<void> {
const TransactionRoute({List<_i18.PageRouteInfo>? children})
: super(TransactionRoute.name, initialChildren: children);
static const String name = 'TransactionRoute';
static _i18.PageInfo page = _i18.PageInfo(
name,
builder: (data) {
return const _i17.TransactionPage();
}, },
); );
} }