build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Describes the part of the user interface represented by this widget.

Implementation

@override
Widget build(BuildContext context) {
  final List<Widget> columnChildren = <Widget>[];

  if (title != null) {
    columnChildren.add(
      Text(
        title!,
        style: titleStyle ?? const TextStyle(color: Color.white, bold: true),
      ),
    );
    columnChildren.add(const Container(height: 1));
  }

  columnChildren.add(child);

  if (actions != null && actions!.isNotEmpty) {
    columnChildren.add(const Container(height: 1));
    columnChildren.add(_buildActionRow());
  }

  final effectivePadding = padding ?? const EdgeInsets.all(2);

  return Card(
    color: backgroundColor,
    padding: effectivePadding,
    child: Column(children: columnChildren),
  );
}