children property

  1. @override
List<Widget> get children
override

The widgets that comprise the cells in this row.

Children may be wrapped in TableCell widgets to provide per-cell configuration to the Table, but children are not required to be wrapped in TableCell widgets.

Implementation

@override
List<Widget> get children => columns
    .map((String col) {
      Widget child = Text(col);
      final bool isLink = col.startsWith('http');

      if (isLink) {
        child = Row(
          spacing: VERY_SMALL_SPACE,
          children: <Widget>[
            Expanded(child: child),
            const icons.ExternalLink(size: 10.0),
          ],
        );
      }

      child = Padding(
        padding: const EdgeInsetsDirectional.all(SMALL_SPACE),
        child: child,
      );

      if (isLink) {
        return InkWell(
          onTap: () => LaunchUrlHelper.launchURL(col),
          child: child,
        );
      }

      return child;
    })
    .toList(growable: false);