SingleChildScrollView constructor

SingleChildScrollView({
  1. Key? key,
  2. required ScrollViewProperties properties,
  3. EdgeInsetsGeometry? padding,
  4. ScrollPhysics? physics,
  5. Widget? child,
  6. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  7. Clip clipBehavior = Clip.hardEdge,
  8. String? restorationId,
  9. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
})

Creates a box in which a single widget can be scrolled.

Implementation

SingleChildScrollView({
  Key? key,
  required ScrollViewProperties properties,
  this.padding,
  this.physics,
  this.child,
  this.dragStartBehavior = DragStartBehavior.start,
  this.clipBehavior = Clip.hardEdge,
  this.restorationId,
  this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
})  : scrollStateKey = properties.scrollStateKey,
      controller = properties.scrollController,
      reverse = properties.reverse,
      scrollDirection = properties.scrollDirection,
      assert(properties.scrollDirection != null),
      assert(dragStartBehavior != null),
      assert(clipBehavior != null),
      assert(
        !(properties.scrollController != null && (properties.primary)),
        'Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. '
        'You cannot both set primary to true and pass an explicit controller.',
      ),
      primary = properties.primary,
      super(key: key);