build method

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

Describes the part of the UI represented by this widget.

Implementation

@override
Widget build(BuildContext context) {
  final errorStyle = Style()
    ..foreground(Colors.red)
    ..bold(true);
  final detailStyle = Style()..foreground(Colors.red);

  final prefix = showIcon ? '✗ ' : '';
  final children = <Widget>[Text('$prefix$message', style: errorStyle)];

  if (details != null && details!.isNotEmpty) {
    children.add(Text(details!, style: detailStyle));
  }

  return Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: children,
  );
}