rowContainer static method

Container rowContainer({
  1. EdgeInsetsGeometry? margin,
  2. EdgeInsetsGeometry? padding,
  3. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start,
  4. MainAxisSize mainAxisSize = MainAxisSize.max,
  5. Color color = Colors.transparent,
  6. List<Widget>? left,
  7. List<Widget>? center,
  8. 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,
    ),
  );
}