diff --git a/lib/screens/lightmeter_pro/components/offering/widget_offering_lightmeter_pro.dart b/lib/screens/lightmeter_pro/components/offering/widget_offering_lightmeter_pro.dart index b3a8f6d..f3d96ff 100644 --- a/lib/screens/lightmeter_pro/components/offering/widget_offering_lightmeter_pro.dart +++ b/lib/screens/lightmeter_pro/components/offering/widget_offering_lightmeter_pro.dart @@ -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 { + Iterable intersperse(Widget element) sync* { + final iterator = this.iterator; + if (iterator.moveNext()) { + yield iterator.current; + while (iterator.moveNext()) { + yield element; + yield iterator.current; + } + } + } +}