feat: change name transaction to order
This commit is contained in:
parent
b8055c8eab
commit
62eb15b27f
@ -11,7 +11,7 @@ class MainPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AutoTabsRouter.pageView(
|
||||
routes: [HomeRoute(), TransactionRoute(), ReportRoute(), ProfileRoute()],
|
||||
routes: [HomeRoute(), OrderRoute(), ReportRoute(), ProfileRoute()],
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
builder: (context, child, pageController) {
|
||||
final tabsRouter = AutoTabsRouter.of(context);
|
||||
|
||||
@ -33,8 +33,8 @@ class _MainBottomNavbarState extends State<MainBottomNavbar> {
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: LineIcon(LineIcons.moneyBill),
|
||||
label: context.lang.transaction,
|
||||
tooltip: context.lang.transaction,
|
||||
label: 'Order',
|
||||
tooltip: 'Order',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: LineIcon(LineIcons.barChart),
|
||||
|
||||
@ -7,18 +7,17 @@ import '../../components/appbar/appbar.dart';
|
||||
import '../../components/button/button.dart';
|
||||
import '../../components/spacer/spacer.dart';
|
||||
import 'widgets/status_tile.dart';
|
||||
import 'widgets/transaction_tile.dart';
|
||||
import 'widgets/order_tile.dart';
|
||||
|
||||
@RoutePage()
|
||||
class TransactionPage extends StatefulWidget {
|
||||
const TransactionPage({super.key});
|
||||
class OrderPage extends StatefulWidget {
|
||||
const OrderPage({super.key});
|
||||
|
||||
@override
|
||||
State<TransactionPage> createState() => _TransactionPageState();
|
||||
State<OrderPage> createState() => _OrderPageState();
|
||||
}
|
||||
|
||||
class _TransactionPageState extends State<TransactionPage>
|
||||
with TickerProviderStateMixin {
|
||||
class _OrderPageState extends State<OrderPage> with TickerProviderStateMixin {
|
||||
late AnimationController _fadeController;
|
||||
late AnimationController _slideController;
|
||||
late Animation<double> _fadeAnimation;
|
||||
@ -139,7 +138,7 @@ class _TransactionPageState extends State<TransactionPage>
|
||||
pinned: true,
|
||||
backgroundColor: AppColor.primary,
|
||||
centerTitle: false,
|
||||
flexibleSpace: CustomAppBar(title: 'Transaction', isBack: false),
|
||||
flexibleSpace: CustomAppBar(title: 'Order', isBack: false),
|
||||
actions: [
|
||||
ActionIconButton(onTap: () {}, icon: LineIcons.filter),
|
||||
SpaceWidth(8),
|
||||
@ -170,7 +169,7 @@ class _TransactionPageState extends State<TransactionPage>
|
||||
padding: EdgeInsets.only(
|
||||
right: index < filterOptions.length - 1 ? 8 : 0,
|
||||
),
|
||||
child: TransactionStatusTile(
|
||||
child: OrderStatusTile(
|
||||
label: option,
|
||||
isSelected: option == selectedFilter,
|
||||
onSelected: (isSelected) {
|
||||
@ -249,7 +248,7 @@ class _TransactionPageState extends State<TransactionPage>
|
||||
children: filteredTransactions.map((
|
||||
transaction,
|
||||
) {
|
||||
return TransactionTile(
|
||||
return OrderTile(
|
||||
transaction: transaction,
|
||||
onTap: () {},
|
||||
);
|
||||
@ -28,13 +28,13 @@ class Transaction {
|
||||
|
||||
enum TransactionStatus { completed, pending, cancelled, refunded }
|
||||
|
||||
class TransactionTile extends StatelessWidget {
|
||||
class OrderTile extends StatelessWidget {
|
||||
final Transaction transaction;
|
||||
final VoidCallback? onTap;
|
||||
final VoidCallback? onPrint;
|
||||
final VoidCallback? onRefund;
|
||||
|
||||
const TransactionTile({
|
||||
const OrderTile({
|
||||
super.key,
|
||||
required this.transaction,
|
||||
this.onTap,
|
||||
@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../common/theme/theme.dart';
|
||||
|
||||
class TransactionStatusTile extends StatelessWidget {
|
||||
class OrderStatusTile extends StatelessWidget {
|
||||
final String label;
|
||||
final bool isSelected;
|
||||
final void Function(bool)? onSelected;
|
||||
const TransactionStatusTile({
|
||||
const OrderStatusTile({
|
||||
super.key,
|
||||
required this.label,
|
||||
this.isSelected = false,
|
||||
@ -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),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -16,7 +16,7 @@ class AppRouter extends RootStackRouter {
|
||||
page: MainRoute.page,
|
||||
children: [
|
||||
AutoRoute(page: HomeRoute.page),
|
||||
AutoRoute(page: TransactionRoute.page),
|
||||
AutoRoute(page: OrderRoute.page),
|
||||
AutoRoute(page: ReportRoute.page),
|
||||
AutoRoute(page: ProfileRoute.page),
|
||||
],
|
||||
|
||||
@ -27,21 +27,21 @@ import 'package:apskel_owner_flutter/presentation/pages/language/language_page.d
|
||||
as _i7;
|
||||
import 'package:apskel_owner_flutter/presentation/pages/main/main_page.dart'
|
||||
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;
|
||||
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;
|
||||
import 'package:apskel_owner_flutter/presentation/pages/purchase/purchase_page.dart'
|
||||
import 'package:apskel_owner_flutter/presentation/pages/profile/profile_page.dart'
|
||||
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;
|
||||
import 'package:apskel_owner_flutter/presentation/pages/sales/sales_page.dart'
|
||||
import 'package:apskel_owner_flutter/presentation/pages/report/report_page.dart'
|
||||
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;
|
||||
import 'package:apskel_owner_flutter/presentation/pages/splash/splash_page.dart'
|
||||
import 'package:apskel_owner_flutter/presentation/pages/schedule/schedule_page.dart'
|
||||
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;
|
||||
import 'package:auto_route/auto_route.dart' as _i18;
|
||||
import 'package:flutter/material.dart' as _i19;
|
||||
@ -253,7 +253,23 @@ class MainRoute extends _i18.PageRouteInfo<void> {
|
||||
}
|
||||
|
||||
/// 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> {
|
||||
const ProductRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(ProductRoute.name, initialChildren: children);
|
||||
@ -263,13 +279,13 @@ class ProductRoute extends _i18.PageRouteInfo<void> {
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i18.WrappedRoute(child: const _i10.ProductPage());
|
||||
return _i18.WrappedRoute(child: const _i11.ProductPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i11.ProfilePage]
|
||||
/// [_i12.ProfilePage]
|
||||
class ProfileRoute extends _i18.PageRouteInfo<void> {
|
||||
const ProfileRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(ProfileRoute.name, initialChildren: children);
|
||||
@ -279,13 +295,13 @@ class ProfileRoute extends _i18.PageRouteInfo<void> {
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i18.WrappedRoute(child: const _i11.ProfilePage());
|
||||
return _i18.WrappedRoute(child: const _i12.ProfilePage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i12.PurchasePage]
|
||||
/// [_i13.PurchasePage]
|
||||
class PurchaseRoute extends _i18.PageRouteInfo<void> {
|
||||
const PurchaseRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(PurchaseRoute.name, initialChildren: children);
|
||||
@ -295,13 +311,13 @@ class PurchaseRoute extends _i18.PageRouteInfo<void> {
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i12.PurchasePage();
|
||||
return const _i13.PurchasePage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i13.ReportPage]
|
||||
/// [_i14.ReportPage]
|
||||
class ReportRoute extends _i18.PageRouteInfo<void> {
|
||||
const ReportRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(ReportRoute.name, initialChildren: children);
|
||||
@ -311,13 +327,13 @@ class ReportRoute extends _i18.PageRouteInfo<void> {
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i18.WrappedRoute(child: const _i13.ReportPage());
|
||||
return _i18.WrappedRoute(child: const _i14.ReportPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i14.SalesPage]
|
||||
/// [_i15.SalesPage]
|
||||
class SalesRoute extends _i18.PageRouteInfo<void> {
|
||||
const SalesRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(SalesRoute.name, initialChildren: children);
|
||||
@ -327,13 +343,13 @@ class SalesRoute extends _i18.PageRouteInfo<void> {
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i18.WrappedRoute(child: const _i14.SalesPage());
|
||||
return _i18.WrappedRoute(child: const _i15.SalesPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i15.SchedulePage]
|
||||
/// [_i16.SchedulePage]
|
||||
class ScheduleRoute extends _i18.PageRouteInfo<void> {
|
||||
const ScheduleRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(ScheduleRoute.name, initialChildren: children);
|
||||
@ -343,13 +359,13 @@ class ScheduleRoute extends _i18.PageRouteInfo<void> {
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i15.SchedulePage();
|
||||
return const _i16.SchedulePage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i16.SplashPage]
|
||||
/// [_i17.SplashPage]
|
||||
class SplashRoute extends _i18.PageRouteInfo<void> {
|
||||
const SplashRoute({List<_i18.PageRouteInfo>? children})
|
||||
: super(SplashRoute.name, initialChildren: children);
|
||||
@ -359,23 +375,7 @@ class SplashRoute extends _i18.PageRouteInfo<void> {
|
||||
static _i18.PageInfo page = _i18.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i16.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();
|
||||
return const _i17.SplashPage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user