update denomination money
This commit is contained in:
@@ -40,6 +40,7 @@ class MultiPaymentWidget extends ConsumerStatefulWidget {
|
||||
final bool showWalletOption;
|
||||
final bool hideAddButton;
|
||||
final bool disableDropdown;
|
||||
final bool showCashDenomination;
|
||||
|
||||
final VoidCallback? onPaymentListChanged;
|
||||
final List<PaymentsTransaction>? initialTransactions;
|
||||
@@ -51,6 +52,7 @@ class MultiPaymentWidget extends ConsumerStatefulWidget {
|
||||
this.showWalletOption = false,
|
||||
this.hideAddButton = false,
|
||||
this.disableDropdown = false,
|
||||
this.showCashDenomination = false,
|
||||
this.onPaymentListChanged,
|
||||
this.initialTransactions,
|
||||
});
|
||||
@@ -345,6 +347,53 @@ class MultiPaymentWidgetState extends ConsumerState<MultiPaymentWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (payment.type == 'Cash' && widget.showCashDenomination)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 15.0),
|
||||
child: Wrap(
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
children: [
|
||||
...[100000, 50000, 20000, 10000, 5000, 2000, 1000, 500].map((amount) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
double currentAmount = double.tryParse(payment.amountController.text) ?? 0.0;
|
||||
payment.amountController.text = (currentAmount + amount).toStringAsFixed(0);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: kMainColor),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
color: kMainColor.withOpacity(0.1),
|
||||
),
|
||||
child: Text(
|
||||
amount.toString(),
|
||||
style: const TextStyle(color: kMainColor, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
payment.amountController.text = '0';
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.red),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
color: Colors.red.withOpacity(0.1),
|
||||
),
|
||||
child: const Text(
|
||||
'Clear',
|
||||
style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user