JsonInteractiveViewer constructor
JsonInteractiveViewer({
- Map<
String, dynamic> args = const {}, - JsonWidgetRegistry? registry,
- Alignment? alignment,
- EdgeInsets boundaryMargin = EdgeInsets.zero,
- Clip clipBehavior = Clip.hardEdge,
- bool constrained = true,
- dynamic interactionEndFrictionCoefficient = 0.0000135,
- double maxScale = 2.5,
- double minScale = 0.8,
- void onInteractionEnd()?,
- void onInteractionStart()?,
- void onInteractionUpdate()?,
- PanAxis panAxis = PanAxis.free,
- bool panEnabled = true,
- bool scaleEnabled = true,
- double scaleFactor = kDefaultMouseScrollToScaleFactor,
- bool trackpadScrollCausesScale = false,
- TransformationController? transformationController,
- required JsonWidgetData child,
Implementation
JsonInteractiveViewer({
Map<String, dynamic> args = const {},
JsonWidgetRegistry? registry,
this.alignment,
this.boundaryMargin = EdgeInsets.zero,
this.clipBehavior = Clip.hardEdge,
this.constrained = true,
this.interactionEndFrictionCoefficient = 0.0000135,
this.maxScale = 2.5,
this.minScale = 0.8,
this.onInteractionEnd,
this.onInteractionStart,
this.onInteractionUpdate,
this.panAxis = PanAxis.free,
this.panEnabled = true,
this.scaleEnabled = true,
this.scaleFactor = kDefaultMouseScrollToScaleFactor,
this.trackpadScrollCausesScale = false,
this.transformationController,
required this.child,
}) : super(
jsonWidgetArgs: JsonInteractiveViewerBuilderModel.fromDynamic(
{
'alignment': alignment,
'boundaryMargin': boundaryMargin,
'clipBehavior': clipBehavior,
'constrained': constrained,
'interactionEndFrictionCoefficient':
interactionEndFrictionCoefficient,
'maxScale': maxScale,
'minScale': minScale,
'onInteractionEnd': onInteractionEnd,
'onInteractionStart': onInteractionStart,
'onInteractionUpdate': onInteractionUpdate,
'panAxis': panAxis,
'panEnabled': panEnabled,
'scaleEnabled': scaleEnabled,
'scaleFactor': scaleFactor,
'trackpadScrollCausesScale': trackpadScrollCausesScale,
'transformationController': transformationController,
'child': child,
...args,
},
args: args,
registry: registry,
),
jsonWidgetBuilder: () => JsonInteractiveViewerBuilder(
args: JsonInteractiveViewerBuilderModel.fromDynamic(
{
'alignment': alignment,
'boundaryMargin': boundaryMargin,
'clipBehavior': clipBehavior,
'constrained': constrained,
'interactionEndFrictionCoefficient':
interactionEndFrictionCoefficient,
'maxScale': maxScale,
'minScale': minScale,
'onInteractionEnd': onInteractionEnd,
'onInteractionStart': onInteractionStart,
'onInteractionUpdate': onInteractionUpdate,
'panAxis': panAxis,
'panEnabled': panEnabled,
'scaleEnabled': scaleEnabled,
'scaleFactor': scaleFactor,
'trackpadScrollCausesScale': trackpadScrollCausesScale,
'transformationController': transformationController,
'child': child,
...args,
},
args: args,
registry: registry,
),
),
jsonWidgetType: JsonInteractiveViewerBuilder.kType,
);