NapaInteractiveViewer constructor
NapaInteractiveViewer({
- EdgeInsets boundaryMargin = EdgeInsets.zero,
- bool constrained = true,
- double maxScale = 2.5,
- double minScale = 0.8,
- bool panEnabled = true,
- bool scaleEnabled = true,
- 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,
),
]);
}