* UI fixes for ionia.

* Changed tips for ionia.
This commit is contained in:
mkyq 2022-07-20 17:59:43 +01:00 committed by GitHub
parent c23c6482bb
commit 32f5a79079
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 16 deletions

View file

@ -539,21 +539,22 @@ class TipButtonGroup extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Container(
children: [ height: 50,
...[ child: ListView.builder(
for (var i = 0; i < tipsList.length; i++) ...[ scrollDirection: Axis.horizontal,
TipButton( itemCount: tipsList.length,
isSelected: _isSelected(tipsList[i].percentage), itemBuilder: (BuildContext context, int index) {
onTap: () => onSelect(tipsList[i]), final tip = tipsList[index];
caption: '${tipsList[i].percentage}%', return Padding(
subTitle: '\$${tipsList[i].additionalAmount}', padding: EdgeInsets.only(right: 5),
), child: TipButton(
SizedBox(width: 4), isSelected: _isSelected(tip.percentage),
] onTap: () => onSelect(tip),
], caption: '${tip.percentage}%',
], subTitle: '\$${tip.additionalAmount}',
); ));
}));
} }
} }

View file

@ -22,7 +22,8 @@ abstract class IoniaMerchPurchaseViewModelBase with Store {
percentage = 0.0; percentage = 0.0;
tips = <IoniaTip>[ tips = <IoniaTip>[
IoniaTip(percentage: 0, originalAmount: amount), IoniaTip(percentage: 0, originalAmount: amount),
IoniaTip(percentage: 10, originalAmount: amount), IoniaTip(percentage: 15, originalAmount: amount),
IoniaTip(percentage: 18, originalAmount: amount),
IoniaTip(percentage: 20, originalAmount: amount), IoniaTip(percentage: 20, originalAmount: amount),
]; ];
selectedTip = tips.first; selectedTip = tips.first;