PinchZoom constructor

const PinchZoom({
  1. Key? key,
  2. required Widget child,
  3. double maxScale = 3.0,
  4. bool zoomEnabled = true,
  5. Function? onZoomStart,
  6. Function? onZoomEnd,
})

Create a PinchZoom.

  • child is the widget used for zooming. This parameter must not be null.

  • maxScale is the maximum allowed scale. Defaults to 3.0. Cannot be null, and must be greater than zero.

  • zoomEnabled can be used to enable/disable zooming.

  • onZoomStart called when the widget goes to its zoomed state.

  • onZoomEnd called when the widget is back to its idle state.

Implementation

const PinchZoom(
    {super.key,
    required this.child,
    // This default maxScale value is eyeballed as reasonable limit for common
    // use cases.
    this.maxScale = 3.0,
    this.zoomEnabled = true,
    this.onZoomStart,
    this.onZoomEnd});