gridCenteredChildren property

Row gridCenteredChildren

Center aligning row's children perfectly on the horizontal AND on the vertical axis when used in a vertical MultichildRenderObject.

e.g. normal Column or ListView with rows inside
 750000   187
 245000   14501
 5000   0.5
 10  1

e.g. using this modifier method to create a grid where row's children
are centered vertically inside the Column or ListView
 750000    187
 245000   14501
  5000     0.5
   10       1

Implementation

Row get gridCenteredChildren {
  return Row(
    mainAxisAlignment: MainAxisAlignment.spaceBetween,
    mainAxisSize: mainAxisSize,
    crossAxisAlignment: crossAxisAlignment,
    textDirection: textDirection,
    verticalDirection: verticalDirection,
    textBaseline: textBaseline,
    children: children.map((Widget child) {
      return Expanded(
        child: Row(
          children: <Widget>[
            const Spacer(),
            child,
            const Spacer(),
          ],
        ),
      );
    }).toList(),
  );
}