NapaInteractiveViewer constructor

NapaInteractiveViewer({
  1. EdgeInsets boundaryMargin = EdgeInsets.zero,
  2. bool constrained = true,
  3. double maxScale = 2.5,
  4. double minScale = 0.8,
  5. bool panEnabled = true,
  6. bool scaleEnabled = true,
  7. NapaWidget? child,
})

Implementation

NapaInteractiveViewer({
  this.boundaryMargin = EdgeInsets.zero,
  this.constrained = true,
  this.maxScale = 2.5,
  this.minScale = 0.8,
  this.panEnabled = true,
  this.scaleEnabled = true,
  this.child,
}) : super(childMode: NapaChildMode.singleChild) {
  properties.addAll([
    InspectableProperty<bool>(
      name: 'constrained',
      getValue: (obj) => constrained,
      setValue: (obj, value, customData) => constrained = value,
    ),
    InspectableProperty<double>(
      name: 'maxScale',
      getValue: (obj) => maxScale,
      setValue: (obj, value, customData) => maxScale = value,
      clamp: (0.0, double.infinity),
    ),
    InspectableProperty<double>(
      name: 'minScale',
      getValue: (obj) => minScale,
      setValue: (obj, value, customData) => minScale = value,
      clamp: (0.0, double.infinity),
    ),
    InspectableProperty<bool>(
      name: 'panEnabled',
      getValue: (obj) => panEnabled,
      setValue: (obj, value, customData) => panEnabled = value,
    ),
    InspectableProperty<bool>(
      name: 'scaleEnabled',
      getValue: (obj) => scaleEnabled,
      setValue: (obj, value, customData) => scaleEnabled = value,
    ),
  ]);
}