NapaGridView constructor

NapaGridView({
  1. Axis scrollDirection = Axis.vertical,
  2. bool reverse = false,
  3. bool? primary,
  4. ScrollPhysics? physics,
  5. bool shrinkWrap = false,
  6. EdgeInsetsGeometry? padding,
  7. int crossAxisCount = 2,
  8. double mainAxisSpacing = 0.0,
  9. double crossAxisSpacing = 0.0,
  10. double childAspectRatio = 1.0,
  11. bool addAutomaticKeepAlives = true,
  12. bool addRepaintBoundaries = true,
  13. bool addSemanticIndexes = true,
  14. double? cacheExtent,
  15. List<NapaWidget>? children,
  16. int? semanticChildCount,
  17. DragStartBehavior dragStartBehavior = .start,
  18. ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior,
  19. Clip clipBehavior = .hardEdge,
  20. HitTestBehavior hitTestBehavior = .opaque,
})

Implementation

NapaGridView({
  super.scrollDirection,
  super.reverse,
  super.primary,
  super.physics,
  super.shrinkWrap,
  super.padding,
  this.crossAxisCount = 2,
  this.mainAxisSpacing = 0.0,
  this.crossAxisSpacing = 0.0,
  this.childAspectRatio = 1.0,
  this.addAutomaticKeepAlives = true,
  this.addRepaintBoundaries = true,
  this.addSemanticIndexes = true,
  super.cacheExtent,
  List<NapaWidget>? children,
  super.semanticChildCount,
  super.dragStartBehavior,
  super.keyboardDismissBehavior,
  super.clipBehavior,
  super.hitTestBehavior,
}) : children = children ?? [],
     super(childMode: NapaChildMode.multipleChildren) {
  properties.addAll([
    InspectableProperty<int>(
      name: 'crossAxisCount',
      getValue: (obj) => crossAxisCount,
      setValue: (obj, value, customData) => crossAxisCount = value,
      clamp: (1, 100),
    ),
    InspectableProperty<double>(
      name: 'mainAxisSpacing',
      getValue: (obj) => mainAxisSpacing,
      setValue: (obj, value, customData) => mainAxisSpacing = value,
      clamp: (0.0, double.infinity),
    ),
    InspectableProperty<double>(
      name: 'crossAxisSpacing',
      getValue: (obj) => crossAxisSpacing,
      setValue: (obj, value, customData) => crossAxisSpacing = value,
      clamp: (0.0, double.infinity),
    ),
    InspectableProperty<double>(
      name: 'childAspectRatio',
      getValue: (obj) => childAspectRatio,
      setValue: (obj, value, customData) => childAspectRatio = value,
      clamp: (0.0, double.infinity),
    ),
    InspectableProperty<bool>(
      name: 'addAutomaticKeepAlives',
      getValue: (obj) => addAutomaticKeepAlives,
      setValue: (obj, value, customData) => addAutomaticKeepAlives = value,
    ),
    InspectableProperty<bool>(
      name: 'addRepaintBoundaries',
      getValue: (obj) => addRepaintBoundaries,
      setValue: (obj, value, customData) => addRepaintBoundaries = value,
    ),
    InspectableProperty<bool>(
      name: 'addSemanticIndexes',
      getValue: (obj) => addSemanticIndexes,
      setValue: (obj, value, customData) => addSemanticIndexes = value,
    ),
  ]);
}