fixed offering padding

This commit is contained in:
Vadim 2025-08-11 11:20:10 +02:00
parent c0881e5b24
commit 4032a510a6

View file

@ -107,24 +107,18 @@ class _Products extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (monthly case final monthly?) if (monthly case final monthly?)
Padding( _ProductItem(
padding: const EdgeInsets.only(bottom: Dimens.paddingS), title: S.of(context).monthly,
child: _ProductItem( price: S.of(context).pricePerMonth(monthly.price),
title: S.of(context).monthly, isSelected: selected == monthly,
price: S.of(context).pricePerMonth(monthly.price), onPressed: () => onProductSelected(monthly),
isSelected: selected == monthly,
onPressed: () => onProductSelected(monthly),
),
), ),
if (yearly case final yearly?) if (yearly case final yearly?)
Padding( _ProductItem(
padding: const EdgeInsets.only(bottom: Dimens.paddingS), title: S.of(context).yearly,
child: _ProductItem( price: S.of(context).pricePerYear(yearly.price),
title: S.of(context).yearly, isSelected: selected == yearly,
price: S.of(context).pricePerYear(yearly.price), onPressed: () => onProductSelected(yearly),
isSelected: selected == yearly,
onPressed: () => onProductSelected(yearly),
),
), ),
if (lifetime case final lifetime?) if (lifetime case final lifetime?)
_ProductItem( _ProductItem(
@ -133,7 +127,7 @@ class _Products extends StatelessWidget {
isSelected: selected == lifetime, isSelected: selected == lifetime,
onPressed: () => onProductSelected(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;
}
}
}
}