StreamingConfig class

Configuration for real-time data streaming in BravenChartPlus.

Controls buffer limits, auto-scroll behavior, window size, and provides callbacks for stream events. This is a simplified version focused on the core streaming use case (no dual-mode complexity).

Basic Example:

BravenChartPlus(
  chartType: ChartType.line,
  series: [...],
  dataStream: sensorDataStream,
  streamingConfig: StreamingConfig(),  // Uses defaults
)

Advanced Example:

BravenChartPlus(
  chartType: ChartType.line,
  series: [...],
  dataStream: sensorDataStream,
  streamingConfig: StreamingConfig(
    maxBufferSize: 5000,           // Smaller buffer
    autoScroll: true,              // Follow latest data
    autoScrollWindowSize: 100,     // Show last 100 points
    resumeAnimationDuration: Duration(milliseconds: 500),  // Slower animation
    onBufferUpdated: (count) {
      print('Buffered: $count points');
    },
  ),
)
Available extensions
Annotations
  • @chartSurface

Constructors

StreamingConfig({int maxBufferSize = 10000, bool autoScroll = true, int autoScrollWindowSize = 150, Duration resumeAnimationDuration = const Duration(milliseconds: 300), void onBufferUpdated(int bufferCount)?, void onStreamError(Object error)?})
Creates a streaming configuration.
const

Properties

autoScroll bool
Whether to automatically scroll viewport to show latest data.
final
autoScrollWindowSize int
Number of data points to display in the auto-scroll window.
final
hashCode int
The hash code for this object.
no setteroverride
maxBufferSize int
Maximum number of data points to buffer.
final
onBufferUpdated → void Function(int bufferCount)?
Callback invoked when data is added to the buffer.
final
onStreamError → void Function(Object error)?
Callback invoked when the data stream throws an error.
final
resumeAnimationDuration Duration
Duration of animation when resuming streaming.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({int? maxBufferSize, bool? autoScroll, int? autoScrollWindowSize, Duration? resumeAnimationDuration, void onBufferUpdated(int bufferCount)?, void onStreamError(Object error)?}) StreamingConfig
Creates a copy with modified properties.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
withAutoScroll(bool value) StreamingConfig

Available on StreamingConfig, provided by the StreamingConfigFluent extension

Replaces StreamingConfig.autoScroll with value.
withAutoScrollWindowSize(int value) StreamingConfig

Available on StreamingConfig, provided by the StreamingConfigFluent extension

Replaces StreamingConfig.autoScrollWindowSize with value.
withMaxBufferSize(int value) StreamingConfig

Available on StreamingConfig, provided by the StreamingConfigFluent extension

Replaces StreamingConfig.maxBufferSize with value.
withResumeAnimationDuration(Duration value) StreamingConfig

Available on StreamingConfig, provided by the StreamingConfigFluent extension

Replaces StreamingConfig.resumeAnimationDuration with value.

Operators

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