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
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 withvalue. -
withAutoScrollWindowSize(
int value) → StreamingConfig -
Available on StreamingConfig, provided by the StreamingConfigFluent extension
Replaces StreamingConfig.autoScrollWindowSize withvalue. -
withMaxBufferSize(
int value) → StreamingConfig -
Available on StreamingConfig, provided by the StreamingConfigFluent extension
Replaces StreamingConfig.maxBufferSize withvalue. -
withResumeAnimationDuration(
Duration value) → StreamingConfig -
Available on StreamingConfig, provided by the StreamingConfigFluent extension
Replaces StreamingConfig.resumeAnimationDuration withvalue.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override