row function

Widget row({
  1. EdgeInsets padding = EdgeInsets.zero,
  2. EdgeInsets margin = EdgeInsets.zero,
  3. List<Widget> children = const <Widget>[],
  4. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
  5. MainAxisSize mainAxisSize = MainAxisSize.max,
  6. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
  7. VerticalDirection verticalDirection = VerticalDirection.down,
  8. BoxDecoration? decoration,
  9. double? width,
  10. double? height,
  11. bool isScrollable = false,
  12. ScrollPhysics? physics,
  13. ScrollController? scrollController,
  14. VoidCallback? onTap,
})

Implementation

Widget row({
  final EdgeInsets padding = EdgeInsets.zero,
  final EdgeInsets margin = EdgeInsets.zero,
  final List<Widget> children = const <Widget>[],
  final MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
  final MainAxisSize mainAxisSize = MainAxisSize.max,
  final CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
  final VerticalDirection verticalDirection = VerticalDirection.down,
  final BoxDecoration? decoration,
  final double? width,
  final double? height,
  final bool isScrollable = false,
  final ScrollPhysics? physics,
  final ScrollController? scrollController,
  final VoidCallback? onTap,
}) =>
    Container(
      width: width,
      height: height,
      decoration: decoration,
      padding: padding,
      margin: margin,
      child: isScrollable
          ? SingleChildScrollView(
              physics: physics ?? const BouncingScrollPhysics(),
              scrollDirection: Axis.horizontal,
              controller: scrollController,
              child: Row(
                mainAxisAlignment: mainAxisAlignment,
                mainAxisSize: mainAxisSize,
                crossAxisAlignment: crossAxisAlignment,
                verticalDirection: verticalDirection,
                children: children,
              ),
            )
          : GestureDetector(
              onTap: onTap,
              child: Row(
                mainAxisAlignment: mainAxisAlignment,
                mainAxisSize: mainAxisSize,
                crossAxisAlignment: crossAxisAlignment,
                verticalDirection: verticalDirection,
                children: children,
              ),
            ),
    );