feat: change name transaction to order
This commit is contained in:
@@ -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),
|
||||
|
||||
+8
-9
@@ -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: () {},
|
||||
);
|
||||
+2
-2
@@ -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
-2
@@ -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),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user