const constructure
This commit is contained in:
@@ -15,14 +15,14 @@ class RefundLeftPanel extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(color: AppColor.white),
|
||||
decoration: const BoxDecoration(color: AppColor.white),
|
||||
child: Column(
|
||||
children: [
|
||||
PageTitle(title: 'Refund Pesanan', subtitle: state.order.orderNumber),
|
||||
_buildInfo(),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
itemCount: state.order.orderItems.length,
|
||||
itemBuilder: (context, index) {
|
||||
return _buildOrderItem(state.order.orderItems[index]);
|
||||
@@ -37,7 +37,7 @@ class RefundLeftPanel extends StatelessWidget {
|
||||
|
||||
Widget _buildOrderItem(OrderItem item) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
@@ -80,7 +80,7 @@ class RefundLeftPanel extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
if ((item.paidQuantity) > 1) ...[
|
||||
SpaceHeight(6),
|
||||
const SpaceHeight(6),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Container(
|
||||
@@ -132,7 +132,7 @@ class RefundLeftPanel extends StatelessWidget {
|
||||
Container _buildInfo() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: AppColor.border)),
|
||||
),
|
||||
child: Column(
|
||||
@@ -177,8 +177,8 @@ class RefundLeftPanel extends StatelessWidget {
|
||||
|
||||
Container _buildFooterSummary() {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(top: BorderSide(color: AppColor.border)),
|
||||
),
|
||||
child: Column(
|
||||
@@ -187,19 +187,19 @@ class RefundLeftPanel extends StatelessWidget {
|
||||
title: 'Subtotal',
|
||||
value: state.order.subtotal.currencyFormatRpV2,
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
_buildSummaryItem(
|
||||
title: 'Pajak',
|
||||
value: state.order.taxAmount.currencyFormatRpV2,
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
_buildSummaryItem(
|
||||
title: 'Diskon',
|
||||
value: state.order.discountAmount.currencyFormatRpV2,
|
||||
),
|
||||
SpaceHeight(8),
|
||||
DashedDivider(color: AppColor.border),
|
||||
SpaceHeight(8),
|
||||
const SpaceHeight(8),
|
||||
const DashedDivider(color: AppColor.border),
|
||||
const SpaceHeight(8),
|
||||
_buildSummaryItem(
|
||||
title: 'Total Dibayar',
|
||||
value: state.order.totalAmount.currencyFormatRpV2,
|
||||
|
||||
@@ -19,7 +19,7 @@ class RefundReasonTile extends StatelessWidget {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: AnimatedContainer(
|
||||
duration: Duration(milliseconds: 300),
|
||||
duration: const Duration(milliseconds: 300),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? reason.color.withOpacity(0.2) : Colors.grey[100],
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
@@ -36,7 +36,7 @@ class RefundReasonTile extends StatelessWidget {
|
||||
color: isSelected ? reason.color : Colors.grey[600],
|
||||
size: 20,
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
Text(
|
||||
reason.value,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -41,7 +41,7 @@ class _RefundRightPanelState extends State<RefundRightPanel> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -52,10 +52,10 @@ class _RefundRightPanelState extends State<RefundRightPanel> {
|
||||
color: AppColor.textPrimary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
Container(
|
||||
width: context.deviceWidth,
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
@@ -70,16 +70,17 @@ class _RefundRightPanelState extends State<RefundRightPanel> {
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(8),
|
||||
const SpaceHeight(8),
|
||||
GridView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
childAspectRatio: 2.5,
|
||||
),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
childAspectRatio: 2.5,
|
||||
),
|
||||
itemCount: refundReasons.length,
|
||||
itemBuilder: (context, index) {
|
||||
final reason = refundReasons[index];
|
||||
@@ -99,7 +100,7 @@ class _RefundRightPanelState extends State<RefundRightPanel> {
|
||||
),
|
||||
if (widget.state.refundReason != null &&
|
||||
widget.state.refundReason!.value == 'Lainnya') ...[
|
||||
SpaceHeight(8),
|
||||
const SpaceHeight(8),
|
||||
AppTextFormField(
|
||||
label: 'Masukkan Alasan',
|
||||
controller: reasonController,
|
||||
@@ -122,7 +123,7 @@ class _RefundRightPanelState extends State<RefundRightPanel> {
|
||||
Widget _buildBottom() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(color: AppColor.white),
|
||||
decoration: const BoxDecoration(color: AppColor.white),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -145,9 +146,9 @@ class _RefundRightPanelState extends State<RefundRightPanel> {
|
||||
),
|
||||
],
|
||||
),
|
||||
SpaceHeight(8),
|
||||
DashedDivider(color: AppColor.border),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(8),
|
||||
const DashedDivider(color: AppColor.border),
|
||||
const SpaceHeight(16),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -156,7 +157,7 @@ class _RefundRightPanelState extends State<RefundRightPanel> {
|
||||
label: 'Batal',
|
||||
),
|
||||
),
|
||||
SpaceWidth(16),
|
||||
const SpaceWidth(16),
|
||||
Expanded(
|
||||
child: AppElevatedButton.filled(
|
||||
onPressed: () {
|
||||
|
||||
Reference in New Issue
Block a user