divider method

List<TableRow> divider({
  1. Color? color,
  2. int lastIndex = -1,
})

Implementation

List<TableRow> divider({Color? color, int lastIndex = -1}) {
  if (isEmpty && length < 1) return this;

  final separator = TableRow(
    children: [
      ...Iterable.generate(
        first.children.length,
        (_) => Container(
          height: 1,
          width: double.infinity,
          color: (color ?? Colors.black.withValues(alpha: 0.2)),
        ),
      ),
    ],
  );

  int inserts = length - 1;

  while (inserts > 0) {
    inserts--;
    lastIndex = lastIndex + 2;
    insert(lastIndex, separator);
  }

  return this;
}