buildProductSmoothCard function
- required Widget body,
- Widget? header,
- Widget? title,
- EdgeInsetsGeometry? titlePadding,
- EdgeInsetsGeometry? padding = EdgeInsets.zero,
- EdgeInsetsGeometry? margin = const EdgeInsets.symmetric(horizontal: SMALL_SPACE),
- BorderRadius? borderRadius,
A SmoothCard on Product cards using default margin and padding.
Implementation
Widget buildProductSmoothCard({
required Widget body,
Widget? header,
Widget? title,
EdgeInsetsGeometry? titlePadding,
EdgeInsetsGeometry? padding = EdgeInsets.zero,
EdgeInsetsGeometry? margin = const EdgeInsets.symmetric(
horizontal: SMALL_SPACE,
),
BorderRadius? borderRadius,
}) {
assert(
(header != null && title == null) || header == null,
"You can't pass a header and a title at the same time",
);
Widget child;
if (title != null) {
child = Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
_ProductSmoothCardTitle(title: title, padding: titlePadding),
body,
],
);
} else if (header != null) {
child = Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[header, body],
);
} else {
child = body;
}
return child;
}