Skip to content

Commit

Permalink
fix: Fixed Scan cards with different sizes (#1573)
Browse files Browse the repository at this point in the history
* Fixed Scan cards with different sizes #1568

* Changed EdgeInsets.only to EdgeInsets.symmetric

* pushed accidentally

* pushed accidentally

* Pushing the correct versions of ios files that were deleted

* Added a line to project.pbxproj to match the remote develop branch

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
  • Loading branch information
Laytoder and teolemon authored Apr 15, 2022
1 parent 5826076 commit ad0f96a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 41 deletions.
8 changes: 3 additions & 5 deletions packages/smooth_app/lib/generic_lib/widgets/smooth_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ class SmoothCard extends StatelessWidget {
const SmoothCard({
required this.child,
this.color,
this.margin = const EdgeInsets.only(
right: SMALL_SPACE,
left: SMALL_SPACE,
top: VERY_SMALL_SPACE,
bottom: VERY_SMALL_SPACE,
this.margin = const EdgeInsets.symmetric(
horizontal: SMALL_SPACE,
vertical: VERY_SMALL_SPACE,
),
this.padding = const EdgeInsets.all(5.0),
this.elevation = 8,
Expand Down
78 changes: 42 additions & 36 deletions packages/smooth_app/lib/pages/product/summary_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,47 +102,53 @@ class _SummaryCardState extends State<SummaryCard> {

Widget _buildLimitedSizeSummaryCard(double parentHeight) {
totalPrintableRows = parentHeight ~/ SUMMARY_CARD_ROW_HEIGHT;
return Stack(
children: <Widget>[
ClipRRect(
borderRadius: ROUNDED_BORDER_RADIUS,
child: OverflowBox(
alignment: AlignmentDirectional.topStart,
minHeight: parentHeight,
maxHeight: double.infinity,
child: buildProductSmoothCard(
header: _buildProductCompatibilityHeader(context),
body: Padding(
padding: SMOOTH_CARD_PADDING,
child: _buildSummaryCardContent(context),
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: SMALL_SPACE,
vertical: VERY_SMALL_SPACE,
),
child: Stack(
children: <Widget>[
ClipRRect(
borderRadius: ROUNDED_BORDER_RADIUS,
child: OverflowBox(
alignment: AlignmentDirectional.topStart,
minHeight: parentHeight,
maxHeight: double.infinity,
child: buildProductSmoothCard(
header: _buildProductCompatibilityHeader(context),
body: Padding(
padding: SMOOTH_CARD_PADDING,
child: _buildSummaryCardContent(context),
),
margin: EdgeInsets.zero,
),
margin: EdgeInsets.zero,
),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
padding: const EdgeInsets.symmetric(
vertical: SMALL_SPACE,
),
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius:
const BorderRadius.vertical(bottom: ROUNDED_RADIUS),
),
child: Center(
child: Text(
AppLocalizations.of(context)!.tab_for_more,
style: Theme.of(context).primaryTextTheme.bodyText1,
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
padding: const EdgeInsets.symmetric(
vertical: SMALL_SPACE,
),
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius:
const BorderRadius.vertical(bottom: ROUNDED_RADIUS),
),
child: Center(
child: Text(
AppLocalizations.of(context)!.tab_for_more,
style: Theme.of(context).primaryTextTheme.bodyText1,
),
),
),
),
],
),
],
],
),
],
),
);
}

Expand Down

0 comments on commit ad0f96a

Please sign in to comment.