ChartZoomController class

A ValueNotifier that owns ChartZoomState and exposes gesture-friendly mutation helpers.

Attach to a ChartInteractionLayer and read .value in painters.

final zoomCtrl = ChartZoomController();

// In a StatefulWidget:
zoomCtrl.addListener(() => setState(() {}));

// Programmatic zoom to data range [20%..60%]:
zoomCtrl.zoomToRange(0.2, 0.6, label: 'Q2');

// Back:
zoomCtrl.pop();
Inheritance

Constructors

ChartZoomController({ChartZoomState? initial, ZoomConstraints constraints = const ZoomConstraints()})

Properties

no setter
canPop bool
no setter
constraints ZoomConstraints
final
depth int
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hasMomentum bool
no setter
isDisposed bool
Whether this zoom controller has been disposed.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ChartZoomState
The current value stored in this notifier.
getter/setter pairinherited-getteroverride-setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
advanceFling() → void
Call every animation frame while hasMomentum is true.
dispose() → void
Discards any resources used by the object.
override
drillDown(double start, double end, {required String label, Map<String, dynamic>? metadata}) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onDoubleTap(double focalX, double canvasWidth) → void
onFlingStart(double velocityX, double canvasWidth) → void
onPanDelta(double deltaX, double canvasWidth) → void
onScaleUpdate(double focalX, double canvasWidth, double scale) → void
onScrollWheel(double deltaY, double focalX, double canvasWidth) → void
pan(double deltaFraction) → void
pop() → void
popAll() → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
setVisibleRange(double start, double end) → void
Replace the current visible range without adding zoom history.
toString() String
A string representation of this object.
inherited
zoomIn(double focalFraction, {double factor = 2.0}) → void
zoomOut({double factor = 2.0}) → void
zoomToIndexRange(int start, int end, int totalPoints, {String label = 'Zoom'}) → void
zoomToRange(double start, double end, {String label = 'Zoom'}) → void

Operators

operator ==(Object other) bool
The equality operator.
inherited