buildList method

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

Implementation

@override
Widget buildList(BuildContext context) {
  final decoration = spec.buildProp("rowDecoration");
  final oddDecoration = spec.buildProp("rowOddDecoration") ?? decoration;

  final tableRows = <TableRow>[];
  for (var i = 0; i < mutable.lastState.fullData.length; i++) {
    tableRows.add(buildTableRow(
      context,
      mutable.lastState.fullData[i],
      i.isEven ? decoration : oddDecoration,
      i,
    ));
  }

  final table = Table(
    key: Key("${id}_list"),
    border: spec.buildProp("border"),
    textBaseline: spec.buildProp("textBaseline"),
    defaultVerticalAlignment:
        spec.buildProp("verticalAlignment") ?? TableCellVerticalAlignment.top,
    children: tableRows,
  );

  if (parseBool(props["shrinkWrap"])) {
    return table;
  } else {
    return SingleChildScrollView(
      controller: controller,
      child: table,
    );
  }
}