withDivider method
Add a divider between each child.
Implementation
IntrinsicHeight withDivider({
double width = 1,
Color? color,
double thickness = 1,
double indent = 0,
double endIndent = 0,
}) {
List<Widget> newChildren = [];
for (int i = 0; i < children.length; i++) {
newChildren.add(children[i]);
if (i < children.length - 1) {
newChildren.add(
VerticalDivider(
width: width,
color: color ?? Colors.grey.shade300,
thickness: thickness,
indent: indent,
endIndent: endIndent,
),
);
}
}
return IntrinsicHeight(
child: Row(
key: key,
mainAxisAlignment: mainAxisAlignment,
mainAxisSize: mainAxisSize,
crossAxisAlignment: crossAxisAlignment,
textDirection: textDirection,
verticalDirection: verticalDirection,
textBaseline: textBaseline,
children: newChildren,
),
);
}