buildCustom method

  1. @override
InteractiveViewer buildCustom({
  1. ChildWidgetBuilder? childBuilder,
  2. required BuildContext context,
  3. required JsonWidgetData data,
  4. Key? key,
})

Custom builder that subclasses must override and implement to return the actual Widget to be placed on the tree.

Implementation

@override
InteractiveViewer buildCustom({
  ChildWidgetBuilder? childBuilder,
  required BuildContext context,
  required JsonWidgetData data,
  Key? key,
}) {
  final model = createModel(
    childBuilder: childBuilder,
    data: data,
  );

  final interactionEndFrictionCoefficientDecoded =
      _decodeInteractionEndFrictionCoefficient(
    value: model.interactionEndFrictionCoefficient,
  );

  return InteractiveViewer(
    alignPanAxis: model.alignPanAxis,
    alignment: model.alignment,
    boundaryMargin: model.boundaryMargin,
    clipBehavior: model.clipBehavior,
    constrained: model.constrained,
    interactionEndFrictionCoefficient:
        interactionEndFrictionCoefficientDecoded,
    key: key,
    maxScale: model.maxScale,
    minScale: model.minScale,
    onInteractionEnd: model.onInteractionEnd,
    onInteractionStart: model.onInteractionStart,
    onInteractionUpdate: model.onInteractionUpdate,
    panAxis: model.panAxis,
    panEnabled: model.panEnabled,
    scaleEnabled: model.scaleEnabled,
    scaleFactor: model.scaleFactor,
    trackpadScrollCausesScale: model.trackpadScrollCausesScale,
    transformationController: model.transformationController,
    child: model.child.build(
      childBuilder: childBuilder,
      context: context,
    ),
  );
}