rowContainer static method
Container
rowContainer({
- EdgeInsetsGeometry? margin,
- EdgeInsetsGeometry? padding,
- CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start,
- MainAxisSize mainAxisSize = MainAxisSize.max,
- Color color = Colors.transparent,
- List<
Widget> ? left, - List<
Widget> ? center, - List<
Widget> ? right,
Row container to display widgets row. Left & Right aligned
Implementation
static Container rowContainer(
{EdgeInsetsGeometry? margin,
EdgeInsetsGeometry? padding,
CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start,
MainAxisSize mainAxisSize = MainAxisSize.max,
Color color = Colors.transparent,
List<Widget>? left,
List<Widget>? center,
List<Widget>? right}) {
if (margin == null) margin = EdgeInsets.all(0);
if (padding == null) padding = EdgeInsets.all(0);
List<Widget> children = [];
if (left != null) {
children.add(Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: mainAxisSize,
children: left,
),
));
}
if (center != null) {
children.add(Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: mainAxisSize,
children: center,
)));
}
if (right != null) {
if (center != null) {
children.add(Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: mainAxisSize,
children: right,
)));
} else {
children.addAll(right);
}
}
return Container(
margin: margin,
padding: padding,
color: color,
child: Row(
crossAxisAlignment: crossAxisAlignment,
mainAxisSize: mainAxisSize,
children: children,
),
);
}