build method

  1. @override
Widget build(
  1. BuildContext context,
  2. Card content
)
override

Builds the layout for the content item. This transforms the content into a Flutter Widget.

Implementation

@override
Widget build(BuildContext context, e.Card content) {
  final variant = _getVariant(content);

  final child = switch (variant) {
    _CardRenderVariant.imageOnly => _buildImageOnly(context, content),
    _CardRenderVariant.imageAndText => _buildImageAndText(context, content),
    _CardRenderVariant.textOnly => _buildTextOnly(context, content),
  };

  return e.PressEffect(
      onTap: content.action != null
          ? (context) => content.action!.execute(context)
          : null,
      child: child);
}