feat: tax page

This commit is contained in:
efrilm
2025-08-01 15:30:33 +07:00
parent 1384253e8a
commit 8c946ce3d9
5 changed files with 149 additions and 139 deletions
@@ -1,3 +1,4 @@
import 'package:enaklo_pos/core/components/custom_modal_dialog.dart';
import 'package:flutter/material.dart';
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
@@ -28,7 +29,8 @@ class _FormTaxDialogState extends State<FormTaxDialog> {
@override
void initState() {
super.initState();
serviceFeeController = TextEditingController(text: widget.serviceChargeValue.toString());
serviceFeeController =
TextEditingController(text: widget.serviceChargeValue.toString());
taxFeeController = TextEditingController(text: widget.taxValue.toString());
}
@@ -41,19 +43,10 @@ class _FormTaxDialogState extends State<FormTaxDialog> {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
onPressed: () => context.pop(),
icon: const Icon(Icons.close),
),
const Text('Edit Perhitungan Biaya'),
const Spacer(),
],
),
content: SingleChildScrollView(
return CustomModalDialog(
title: 'Edit Perhitungan Biaya',
contentPadding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: SizedBox(
width: context.deviceWidth / 3,
child: Column(
@@ -78,12 +71,13 @@ class _FormTaxDialogState extends State<FormTaxDialog> {
Button.filled(
onPressed: () {
final taxValue = int.tryParse(taxFeeController.text) ?? 0;
final serviceChargeValue = int.tryParse(serviceFeeController.text) ?? 0;
final serviceChargeValue =
int.tryParse(serviceFeeController.text) ?? 0;
if (widget.onSave != null) {
widget.onSave!(taxValue, serviceChargeValue);
}
context.pop();
},
label: 'Simpan',