Skip to content

Commit

Permalink
fix: If a "panel summary widget" is incomplete, the app shouldn't cra…
Browse files Browse the repository at this point in the history
…sh (#4987)

* In the case where a "panel summary widget" is null, we have to pass a non-null WIdget

* Add a missing `const`
  • Loading branch information
g123k authored Jan 15, 2024
1 parent d1188c9 commit 735ae8c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
17 changes: 10 additions & 7 deletions packages/smooth_app/lib/helpers/product_cards_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,16 @@ Widget buildProductSmoothCard({
SmoothCard(
margin: margin,
padding: padding,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (header != null) header,
body,
],
),
child: switch (header) {
Object _ => Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (header != null) header,
body,
],
),
_ => body
},
);

// used to be in now defunct `AttributeListExpandable`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ class KnowledgePanelCard extends StatelessWidget {
),
),
child: KnowledgePanelsBuilder.getPanelSummaryWidget(
panel,
isClickable: isClickable,
margin: EdgeInsets.zero,
),
panel,
isClickable: isClickable,
margin: EdgeInsets.zero,
) ??
const SizedBox(),
),
);
}
Expand Down

0 comments on commit 735ae8c

Please sign in to comment.