NapaScrollView constructor

NapaScrollView({
  1. NapaChildMode childMode = NapaChildMode.noChildren,
  2. Axis scrollDirection = Axis.vertical,
  3. bool reverse = false,
  4. bool? primary,
  5. ScrollPhysics? physics,
  6. ScrollBehavior? scrollBehavior,
  7. bool shrinkWrap = false,
  8. double anchor = 0.0,
  9. double? cacheExtent,
  10. int? semanticChildCount,
  11. SliverPaintOrder paintOrder = .firstIsTop,
  12. DragStartBehavior dragStartBehavior = .start,
  13. ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior,
  14. Clip clipBehavior = .hardEdge,
  15. HitTestBehavior hitTestBehavior = .opaque,
})

Implementation

NapaScrollView({
  super.childMode,
  this.scrollDirection = Axis.vertical,
  this.reverse = false,
  this.primary,
  this.physics,
  this.scrollBehavior,
  this.shrinkWrap = false,
  this.anchor = 0.0,
  this.cacheExtent,
  this.semanticChildCount,
  this.paintOrder = .firstIsTop,
  this.dragStartBehavior = .start,
  this.keyboardDismissBehavior,
  this.clipBehavior = .hardEdge,
  this.hitTestBehavior = .opaque,
}) {
  properties.addAll([
    InspectableProperty<double>(
      name: 'anchor',
      getValue: (obj) => anchor,
      setValue: (obj, value, customData) => anchor = value,
    ),
    InspectableProperty<double>(
      name: 'cacheExtent',
      nullable: true,
      getValue: (obj) => cacheExtent,
      setValue: (obj, value, customData) => cacheExtent = value,
    ),
    InspectableProperty<Enum>(
      name: 'clipBehavior',
      getValue: (obj) => clipBehavior,
      setValue: (obj, value, customData) => clipBehavior = value,
      values: () => Clip.values,
    ),
    InspectableProperty<Enum>(
      name: 'dragStartBehavior',
      getValue: (obj) => dragStartBehavior,
      setValue: (obj, value, customData) => dragStartBehavior = value,
      values: () => DragStartBehavior.values,
    ),
    InspectableProperty<Enum>(
      name: 'hitTestBehavior',
      getValue: (obj) => hitTestBehavior,
      setValue: (obj, value, customData) => hitTestBehavior = value,
      values: () => HitTestBehavior.values,
    ),
    InspectableProperty<Enum>(
      name: 'keyboardDismissBehavior',
      nullable: true,
      getValue: (obj) => keyboardDismissBehavior,
      setValue: (obj, value, customData) => keyboardDismissBehavior = value,
      values: () => ScrollViewKeyboardDismissBehavior.values,
    ),
    InspectableProperty<Enum>(
      name: 'paintOrder',
      getValue: (obj) => paintOrder,
      setValue: (obj, value, customData) => paintOrder = value,
      values: () => SliverPaintOrder.values,
    ),
    InspectableProperty<bool>(
      name: 'primary',
      nullable: true,
      getValue: (obj) => primary,
      setValue: (obj, value, customData) => primary = value,
    ),
    InspectableProperty<bool>(
      name: 'reverse',
      getValue: (obj) => reverse,
      setValue: (obj, value, customData) => reverse = value,
    ),
    InspectableProperty<Enum>(
      name: 'scrollDirection',
      getValue: (obj) => scrollDirection,
      setValue: (obj, value, customData) => scrollDirection = value,
      values: () => Axis.values,
    ),
    InspectableProperty<int>(
      name: 'semanticChildCount',
      nullable: true,
      getValue: (obj) => semanticChildCount,
      setValue: (obj, value, customData) => semanticChildCount = value,
    ),
    InspectableProperty<bool>(
      name: 'shrinkWrap',
      getValue: (obj) => shrinkWrap,
      setValue: (obj, value, customData) => shrinkWrap = value,
    ),
  ]);
}