ChartSyncGroup class

Coordinator that manages synchronization between multiple TradingChartController instances.

Supports linking:

  • Crosshair cursor and hovered timestamp across assets / timeframes
  • Horizontal pan / time scrolling
  • Focal zoom scale
Inheritance

Constructors

ChartSyncGroup({bool syncCrosshair = true, bool syncTimeScroll = true, bool syncTimeZoom = true})

Properties

controllers → List<TradingChartController>
Unmodifiable view of registered controllers.
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
syncCrosshair ↔ bool
Whether crosshair position is synchronized across charts.
getter/setter pair
syncTimeScroll ↔ bool
Whether time pan and scroll offset are synchronized across charts.
getter/setter pair
syncTimeZoom ↔ bool
Whether zoom level and candle width are synchronized across charts.
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
broadcastCrosshair({required TradingChartController source, required DateTime? timestamp, double? yPriceRatio}) → void
Broadcasts crosshair movement from source to all sibling charts.
broadcastPan({required TradingChartController source, required double deltaX}) → void
Broadcasts horizontal pan delta from source to all sibling charts.
broadcastZoom({required TradingChartController source, required double scaleFactor, required double focalPointRatio}) → void
Broadcasts zoom factor from source to all sibling charts.
clearCrosshair({TradingChartController? source}) → void
Clears crosshairs across all controllers.
dispose() → void
Discards any resources used by the object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
register(TradingChartController controller) → void
Registers a controller into this sync group.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() → String
A string representation of this object.
inherited
unregister(TradingChartController controller) → void
Unregisters a controller from this sync group.

Operators

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

Static Methods

findClosestCandleIndex(List<DateTime> timestamps, DateTime targetTime) → int
Finds the index of the candle with the closest timestamp to targetTime.