JsonInteractiveViewer constructor

JsonInteractiveViewer({
  1. Map<String, dynamic> args = const {},
  2. JsonWidgetRegistry? registry,
  3. Alignment? alignment,
  4. EdgeInsets boundaryMargin = EdgeInsets.zero,
  5. Clip clipBehavior = Clip.hardEdge,
  6. bool constrained = true,
  7. dynamic interactionEndFrictionCoefficient = 0.0000135,
  8. double maxScale = 2.5,
  9. double minScale = 0.8,
  10. void onInteractionEnd(
    1. ScaleEndDetails
    )?,
  11. void onInteractionStart(
    1. ScaleStartDetails
    )?,
  12. void onInteractionUpdate(
    1. ScaleUpdateDetails
    )?,
  13. PanAxis panAxis = PanAxis.free,
  14. bool panEnabled = true,
  15. bool scaleEnabled = true,
  16. double scaleFactor = kDefaultMouseScrollToScaleFactor,
  17. bool trackpadScrollCausesScale = false,
  18. TransformationController? transformationController,
  19. 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,
      );