fiux stepper in tip calc
This commit is contained in:
parent
11fc606270
commit
949bb7277d
2 changed files with 28 additions and 13 deletions
|
|
@ -115,7 +115,8 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: _currentValue < (widget.minValue ?? 0) ||
|
visible: _currentValue < (widget.minValue ?? 0) ||
|
||||||
_currentValue > widget.maxValue!,
|
(widget.maxValue != null &&
|
||||||
|
_currentValue > widget.maxValue!),
|
||||||
child: const SizedBox(
|
child: const SizedBox(
|
||||||
height: 21,
|
height: 21,
|
||||||
),
|
),
|
||||||
|
|
@ -197,7 +198,8 @@ class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: _currentValue < (widget.minValue ?? 0) ||
|
visible: _currentValue < (widget.minValue ?? 0) ||
|
||||||
_currentValue > widget.maxValue!,
|
(widget.maxValue != null &&
|
||||||
|
_currentValue > widget.maxValue!),
|
||||||
child: const SizedBox(
|
child: const SizedBox(
|
||||||
height: 21,
|
height: 21,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -232,6 +232,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
splitBillController.text = "No";
|
splitBillController.text = "No";
|
||||||
|
noPeopleController.text = "2";
|
||||||
splitPosition = false;
|
splitPosition = false;
|
||||||
splitBillController.addListener(splitSelected);
|
splitBillController.addListener(splitSelected);
|
||||||
}
|
}
|
||||||
|
|
@ -296,17 +297,29 @@ class _TipCalcState extends State<TipCalc> {
|
||||||
secondaryFillColor:
|
secondaryFillColor:
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
onChange: (value) {
|
onChange: (value) {
|
||||||
|
setState(() {
|
||||||
|
splitBillController.text = value ? "Yes" : "No";
|
||||||
|
splitPosition = value;
|
||||||
if (value) {
|
if (value) {
|
||||||
setState(() {
|
noPeopleController.text =
|
||||||
splitBillController.text = "Yes";
|
noPeopleController.text.isEmpty
|
||||||
splitPosition = value;
|
? "2"
|
||||||
});
|
: noPeopleController.text;
|
||||||
} else {
|
} else {
|
||||||
setState(() {
|
noPeopleController.clear();
|
||||||
splitBillController.text = "No";
|
|
||||||
splitPosition = value;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
// if (value) {
|
||||||
|
// setState(() {
|
||||||
|
// splitBillController.text = "Yes";
|
||||||
|
// splitPosition = value;
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// setState(() {
|
||||||
|
// splitBillController.text = "No";
|
||||||
|
// splitPosition = value;
|
||||||
|
// });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ValueListenableBuilder(
|
ValueListenableBuilder(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue