scrollable method

Widget scrollable({
  1. Axis axis = Axis.vertical,
  2. bool enabled = true,
  3. bool reverse = false,
  4. ScrollPhysics? physics,
  5. EdgeInsetsGeometry? padding,
  6. bool? primary,
  7. ScrollController? controller,
  8. Widget? child,
  9. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  10. Clip clipBehavior = Clip.hardEdge,
  11. HitTestBehavior hitTestBehavior = HitTestBehavior.opaque,
  12. String? restorationId,
  13. ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior,
})

Wraps the widget in a SingleChildScrollView.

Implementation

Widget scrollable({
  Axis axis = Axis.vertical,
  bool enabled = true,
  bool reverse = false,
  ScrollPhysics? physics,
  EdgeInsetsGeometry? padding,
  bool? primary,
  ScrollController? controller,
  Widget? child,
  DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  Clip clipBehavior = Clip.hardEdge,
  HitTestBehavior hitTestBehavior = HitTestBehavior.opaque,
  String? restorationId,
  ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior,
}) => enabled
    ? SingleChildScrollView(
        scrollDirection: axis,
        reverse: reverse,
        physics: physics,
        padding: padding,
        primary: primary,
        controller: controller,
        dragStartBehavior: dragStartBehavior,
        clipBehavior: clipBehavior,
        hitTestBehavior: hitTestBehavior,
        restorationId: restorationId,
        keyboardDismissBehavior: keyboardDismissBehavior,
        child: this,
      )
    : this;