feat: tax page
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user