RawStreamBeacon<T> class

See: Beacon.rawStream()

Inheritance
Available extensions

Constructors

RawStreamBeacon(Stream<T> _compute(), {required bool shouldSleep, bool isLazy = false, bool cancelOnError = false, Function? onError, void onDone()?, T? initialValue, String? name})
@macro rawStream

Properties

$$widgetSubscribers$$ Set<int>
The hashcode of all widgets subscribed to this beacon. This should not be used directly.
finalinherited
cancelOnError bool
passed to the internal stream subscription
final
hashCode int
The hash code for this object.
no setteroverride
initialValue → T
The initial value of the beacon.
no setterinherited
isData bool

Available on ReadableBeacon<AsyncValue<T>>, provided by the ReadableAsyncBeaconUtils extension

Returns true if this is AsyncData. This is equivalent to beacon.peek().isData.
no setter
isDisposed bool
Returns true if the beacon has been disposed.
no setterinherited
isEmpty bool
Returns true if the beacon has not been initialized.
no setterinherited
isError bool

Available on ReadableBeacon<AsyncValue<T>>, provided by the ReadableAsyncBeaconUtils extension

Returns true if this is AsyncError. This is equivalent to beacon.peek().isError.
no setter
isIdle bool

Available on ReadableBeacon<AsyncValue<T>>, provided by the ReadableAsyncBeaconUtils extension

Returns true if this is AsyncIdle. This is equivalent to beacon.peek().isIdle.
no setter
isIdleOrLoading bool

Available on ReadableBeacon<AsyncValue<T>>, provided by the ReadableAsyncBeaconUtils extension

Returns true if this is AsyncIdle or AsyncLoading. This is equivalent to beacon.peek().isIdleOrLoading.
no setter
isLazy bool
Whether the beacon has lazy initialization.
final
isLoading bool

Available on ReadableBeacon<AsyncValue<T>>, provided by the ReadableAsyncBeaconUtils extension

Returns true if this is AsyncLoading. This is equivalent to beacon.peek().isLoading.
no setter
lastData → T?

Available on ReadableBeacon<AsyncValue<T>>, provided by the ReadableAsyncBeaconUtils extension

Returns the last data that was successfully loaded This is useful when you want to display old data when in AsyncError or AsyncLoading state. equivalent to beacon.peek().lastData
no setter
listenersCount int
The number of listeners subscribed to this beacon.
no setterinherited
name String
The name of the beacon. For debugging purposes.
no setterinherited
onDone → void Function()?
called when the stream is done
final
onError Function?
called when the stream emits an error
final
previousValue → T?
The previous value of the beacon.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldSleep bool
Whether the beacon should sleep when there are no observers.
final
stream Stream<T>
Returns a broadcast Stream that emits the current value and all subsequent updates to the value of this beacon.
no setterinherited
value → T
Returns the current value and subscribes to changes in the beacon when used within a Beacon.effect or Beacon.derived.
no setterinherited

Methods

buffer(int count, {String? name}) → ReadableBufferedBeacon<T>

Available on ReadableBeacon<T>, provided by the ReadableBeaconWrapUtils extension

Returns a BufferedCountBeacon that wraps this Beacon.
bufferTime(Duration duration, {String? name}) → ReadableBufferedBeacon<T>

Available on ReadableBeacon<T>, provided by the ReadableBeaconWrapUtils extension

Returns a BufferedTimeBeacon that wraps this Beacon.
call() → T
Equivalent to calling value getter.
inherited
debounce(Duration duration, {bool allowFirst = false, String? name}) ReadableBeacon<T>

Available on ReadableBeacon<T>, provided by the ReadableBeaconWrapUtils extension

Returns a DebouncedBeacon that wraps this Beacon.
dispose() → void
Clears all registered listeners and resouces used by the beacon. You will not be able to update or subscribe to the beacon after it has been disposed.
inherited
filter(bool filter(T?, T), {String? name, bool allowFirst = false}) → ReadableFilteredBeacon<T>

Available on ReadableBeacon<T>, provided by the ReadableBeaconWrapUtils extension

Returns a FilteredBeacon that wraps this Beacon.
guard() → void
Prevents the beacon from being disposed by its dependants. The beacon will still be disposed if its dependencies are disposed.
inherited
map<O>(MapFilter<T, O> mapFN, {String? name}) ReadableBeacon<O>

Available on ReadableBeacon<T>, provided by the ReadableBeaconWrapUtils extension

Returns a ReadableBeacon that wraps a Beacon and tranforms its values.
next({bool filter(T)?, T? fallback}) Future<T>

Available on ReadableBeacon<T>, provided by the ReadableBeaconUtils extension

Listens for the next value emitted by this Beacon and returns it as a Future.
nextOrNull({bool filter(T)?}) Future<T?>

Available on ReadableBeacon<T>, provided by the ReadableBeaconUtils extension

Listens for the next value emitted by this Beacon and returns it as a Future.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observe(BuildContext context, ObserverCallback<T> callback) → void

Available on BaseBeacon<T>, provided by the WidgetUtils extension

Observes the state of a beacon and triggers a callback with the current state.
onDispose(VoidCallback callback) → VoidCallback
Registers a callback to be called when the beacon is disposed. Returns a function that can be called to remove the callback.
inherited
pause([Future<void>? resumeSignal]) → void
Pauses the internal stream subscription
peek() → T
Return the current value of the beacon without subscribing to it.
inherited
resume() → void
Resumes the internal stream subscription if it was paused.
subscribe(void callback(T), {bool startNow = true}) → VoidCallback
Subscribes to changes in the beacon returns a function that can be called to unsubscribe
inherited
throttle(Duration duration, {bool dropBlocked = true, String? name}) → ReableThrottledBeacon<T>

Available on ReadableBeacon<T>, provided by the ReadableBeaconWrapUtils extension

Returns a ThrottledBeacon that wraps this Beacon.
toListenable() ValueListenable<T>

Available on ReadableBeacon<T>, provided by the ReadableBeaconFlutterUtils extension

Converts this to a ValueListenable
toString() String
A string representation of this object.
inherited
unsubscribe() → void
unsubscribes from the internal stream
unwrapValue() → T

Available on ReadableBeacon<AsyncValue<T>>, provided by the ReadableAsyncBeaconUtils extension

If this beacon's value is AsyncData, returns it's value. Otherwise throws an exception. equivalent to beacon.peek().unwrap()
unwrapValueOrNull() → T?

Available on ReadableBeacon<AsyncValue<T>>, provided by the ReadableAsyncBeaconUtils extension

If this beacon's value is AsyncData, returns it's value. Otherwise returns null. equivalent to beacon.peek().unwrapOrNull()
watch(BuildContext context) → T

Available on BaseBeacon<T>, provided by the WidgetUtils extension

Watches a beacon and triggers a widget rebuild when its value changes.

Operators

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