mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-08-17 18:46:47 +00:00
fixed offering padding
This commit is contained in:
parent
c0881e5b24
commit
4032a510a6
1 changed files with 24 additions and 17 deletions
|
@ -107,24 +107,18 @@ class _Products extends StatelessWidget {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (monthly case final monthly?)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: Dimens.paddingS),
|
||||
child: _ProductItem(
|
||||
title: S.of(context).monthly,
|
||||
price: S.of(context).pricePerMonth(monthly.price),
|
||||
isSelected: selected == monthly,
|
||||
onPressed: () => onProductSelected(monthly),
|
||||
),
|
||||
_ProductItem(
|
||||
title: S.of(context).monthly,
|
||||
price: S.of(context).pricePerMonth(monthly.price),
|
||||
isSelected: selected == monthly,
|
||||
onPressed: () => onProductSelected(monthly),
|
||||
),
|
||||
if (yearly case final yearly?)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: Dimens.paddingS),
|
||||
child: _ProductItem(
|
||||
title: S.of(context).yearly,
|
||||
price: S.of(context).pricePerYear(yearly.price),
|
||||
isSelected: selected == yearly,
|
||||
onPressed: () => onProductSelected(yearly),
|
||||
),
|
||||
_ProductItem(
|
||||
title: S.of(context).yearly,
|
||||
price: S.of(context).pricePerYear(yearly.price),
|
||||
isSelected: selected == yearly,
|
||||
onPressed: () => onProductSelected(yearly),
|
||||
),
|
||||
if (lifetime case final lifetime?)
|
||||
_ProductItem(
|
||||
|
@ -133,7 +127,7 @@ class _Products extends StatelessWidget {
|
|||
isSelected: selected == lifetime,
|
||||
onPressed: () => onProductSelected(lifetime),
|
||||
),
|
||||
],
|
||||
].intersperse(const SizedBox(height: Dimens.grid8)).toList(growable: false),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -220,3 +214,16 @@ class _ProductAnimatedText extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension on List<Widget> {
|
||||
Iterable<Widget> intersperse(Widget element) sync* {
|
||||
final iterator = this.iterator;
|
||||
if (iterator.moveNext()) {
|
||||
yield iterator.current;
|
||||
while (iterator.moveNext()) {
|
||||
yield element;
|
||||
yield iterator.current;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue