Beacon class abstract

Constructors

Beacon()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

bufferedCount<T>(int count) BufferedCountBeacon<T>
Creates a BufferedCountBeacon that collects and buffers a specified number of values. Once the count threshold is reached, the beacon's value is updated with the list of collected values and the buffer is reset.
bufferedTime<T>({required Duration duration}) BufferedTimeBeacon<T>
Creates a BufferedTimeBeacon that collects values over a specified time duration. Once the time duration elapses, the beacon's value is updated with the list of collected values and the buffer is reset for the next interval.
createEffect(Function fn) → VoidCallback
Creates an effect based on a provided function. The provided function will be called whenever one of its dependencies change.
debounced<T>(T initialValue, {required Duration duration}) DebouncedBeacon<T>
Creates a DebouncedBeacon with an initial value and a debounce duration. This beacon delays updates to its value based on the duration.
derived<T>(T compute(), {bool manualStart = false}) DerivedBeacon<T>
Creates a DerivedBeacon whose value is derived from a computation function. This beacon will recompute its value everytime one of it's dependencies change.
derivedFuture<T>(Future<T> compute(), {bool manualStart = false}) DerivedFutureBeacon<T>
Creates a DerivedBeacon whose value is derived from an asynchronous computation. This beacon will recompute its value every time one of its dependencies change. The result is wrapped in an AsyncValue, which can be in one of three states: loading, data, or error.
doBatchUpdate(VoidCallback callback) → void
Executes a batched update which allows multiple updates to be batched into a single update. This can be used to optimize performance by reducing the number of update notifications.
filtered<T>(T initialValue, BeaconFilter<T> filter) FilteredBeacon<T>
Creates a FilteredBeacon with an initial value and a filter function. This beacon updates its value only if it passes the filter criteria.
future<T>(Future<T> future(), {bool manualStart = false}) FutureBeacon<T>
Creates a FutureBeacon that initializes its value based on a future. The beacon can optionally depend on another ReadableBeacon.
lazyDebounced<T>({T? initialValue, required Duration duration}) DebouncedBeacon<T>
Like debounced, but the initial value is lazily initialized.
lazyFiltered<T>({T? initialValue, required BeaconFilter<T> filter}) FilteredBeacon<T>
Like filtered, but the initial value is lazily initialized.
lazyThrottled<T>({T? initialValue, required Duration duration}) ThrottledBeacon<T>
Like throttled, but the initial value is lazily initialized.
lazyTimestamped<T>([T? initialValue]) TimestampBeacon<T>
Like timestamped, but the initial value is lazily initialized.
lazyUndoRedo<T>({T? initialValue, int historyLimit = 10}) UndoRedoBeacon<T>
Like undoRedo, but the initial value is lazily initialized.
lazyWritable<T>([T? initialValue]) WritableBeacon<T>
Like writable, but the initial value is lazily initialized.
list<T>([List<T>? initialValue]) ListBeacon<T>
Creates a ListBeacon with an initial list value. This beacon manages a list of items, allowing for reactive updates and manipulations of the list.
readable<T>(T initialValue) ReadableBeacon<T>
Creates a ReadableBeacon with an initial value. This beacon allows only reading the value.
scopedWritable<T>(T initialValue) → (ReadableBeacon<T>, void Function(T))
Returns a ReadableBeacon and a function that allows writing to the beacon. This is useful for creating a beacon that's readable by the public, but writable only by the owner.
stream<T>(Stream<T> stream, {bool cancelOnError = false}) StreamBeacon<T>
Creates a StreamBeacon from a given stream. This beacon updates its value based on the stream's emitted values.
throttled<T>(T? initialValue, {required Duration duration}) ThrottledBeacon<T>
Creates a ThrottledBeacon with an initial value and a throttle duration. This beacon limits the rate of updates to its value based on the duration. Updates that occur faster than the throttle duration are ignored.
timestamped<T>(T initialValue) TimestampBeacon<T>
Creates a TimestampBeacon with an initial value. This beacon attaches a timestamp to each value update.
undoRedo<T>(T initialValue, {int historyLimit = 10}) UndoRedoBeacon<T>
Creates an UndoRedoBeacon with an initial value and an optional history limit. This beacon allows undoing and redoing changes to its value, up to the specified number of past states.
writable<T>(T initialValue) WritableBeacon<T>
Creates a WritableBeacon with an initial value. This beacon allows both reading and writing the value.