* 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
Widget build(BuildContext context) {
return Row(
children: [
...[
for (var i = 0; i < tipsList.length; i++) ...[
TipButton(
isSelected: _isSelected(tipsList[i].percentage),
onTap: () => onSelect(tipsList[i]),
caption: '${tipsList[i].percentage}%',
subTitle: '\$${tipsList[i].additionalAmount}',
),
SizedBox(width: 4),
]
],
],
);
return Container(
height: 50,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: tipsList.length,
itemBuilder: (BuildContext context, int index) {
final tip = tipsList[index];
return Padding(
padding: EdgeInsets.only(right: 5),
child: TipButton(
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;
tips = <IoniaTip>[
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),
];
selectedTip = tips.first;