forked from yaso_meth/mih-project
fiux stepper in tip calc
This commit is contained in:
@@ -115,7 +115,8 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||
),
|
||||
Visibility(
|
||||
visible: _currentValue < (widget.minValue ?? 0) ||
|
||||
_currentValue > widget.maxValue!,
|
||||
(widget.maxValue != null &&
|
||||
_currentValue > widget.maxValue!),
|
||||
child: const SizedBox(
|
||||
height: 21,
|
||||
),
|
||||
@@ -197,7 +198,8 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||
),
|
||||
Visibility(
|
||||
visible: _currentValue < (widget.minValue ?? 0) ||
|
||||
_currentValue > widget.maxValue!,
|
||||
(widget.maxValue != null &&
|
||||
_currentValue > widget.maxValue!),
|
||||
child: const SizedBox(
|
||||
height: 21,
|
||||
),
|
||||
|
||||
@@ -232,6 +232,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
splitBillController.text = "No";
|
||||
noPeopleController.text = "2";
|
||||
splitPosition = false;
|
||||
splitBillController.addListener(splitSelected);
|
||||
}
|
||||
@@ -296,17 +297,29 @@ class _TipCalcState extends State<TipCalc> {
|
||||
secondaryFillColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onChange: (value) {
|
||||
if (value) {
|
||||
setState(() {
|
||||
splitBillController.text = "Yes";
|
||||
splitPosition = value;
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
splitBillController.text = "No";
|
||||
splitPosition = value;
|
||||
});
|
||||
}
|
||||
setState(() {
|
||||
splitBillController.text = value ? "Yes" : "No";
|
||||
splitPosition = value;
|
||||
if (value) {
|
||||
noPeopleController.text =
|
||||
noPeopleController.text.isEmpty
|
||||
? "2"
|
||||
: noPeopleController.text;
|
||||
} else {
|
||||
noPeopleController.clear();
|
||||
}
|
||||
});
|
||||
// if (value) {
|
||||
// setState(() {
|
||||
// splitBillController.text = "Yes";
|
||||
// splitPosition = value;
|
||||
// });
|
||||
// } else {
|
||||
// setState(() {
|
||||
// splitBillController.text = "No";
|
||||
// splitPosition = value;
|
||||
// });
|
||||
// }
|
||||
},
|
||||
),
|
||||
ValueListenableBuilder(
|
||||
|
||||
Reference in New Issue
Block a user