column function

Widget column({
  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. VoidCallback? onTap,
  14. ScrollController? scrollController,
})

Implementation

Widget column({
  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 VoidCallback? onTap,
  final ScrollController? scrollController,
}) =>
    Container(
      width: width,
      height: height,
      decoration: decoration,
      padding: padding,
      margin: margin,
      child: isScrollable
          ? SingleChildScrollView(
              physics: physics ?? const BouncingScrollPhysics(),
              controller: scrollController,
              child: Column(
                mainAxisAlignment: mainAxisAlignment,
                mainAxisSize: mainAxisSize,
                crossAxisAlignment: crossAxisAlignment,
                verticalDirection: verticalDirection,
                children: children,
              ),
            )
          : GestureDetector(
              onTap: onTap,
              child: Column(
                mainAxisAlignment: mainAxisAlignment,
                mainAxisSize: mainAxisSize,
                crossAxisAlignment: crossAxisAlignment,
                verticalDirection: verticalDirection,
                children: children,
              ),
            ),
    );