state_beacon library
reactive primitive and statemanagement for flutter
Classes
-
AsyncData<
T> - A class that represents a value that is loaded asynchronously.
-
AsyncError<
T> - A class that represents an error that occurred while loading a value.
-
AsyncIdle<
T> - A class that represents an idle state.
-
AsyncLoading<
T> - A class that represents a value that is being loaded asynchronously.
-
AsyncSingletonRef<
T> - A AsyncSingletonRef is a reference with an asynchronous factory/creation function that always return the same instance.
-
AsyncTransientRef<
T> - A AsyncTransientRef is a reference with an asynchronous factory/creation function that always return a new instance.
-
AsyncValue<
T> - A class that represents a value that is loaded asynchronously. It can be in one of the following states:
- BeaconController
- An abstract mixin class that automatically disposes all beacons created by this controller.
-
BeaconFamily<
Arg, BeaconType extends ReadableBeacon> -
This returns a beacon that is created using the provided
createfunction. The beacon is cached and returned if the same argument is provided again. - BeaconGroup
-
An alternative to the global beacon creator ie:
Beacon.writable(0); that keeps track of all beacons and effects created so they can be disposed/reset together. This is useful when you're creating multiple beacons in a stateful widget or controller class and want to dispose them together. - BeaconObserver
- A class that observes beacons.
- BeaconScheduler
-
Effectsare not synchronous, their execution is controlled by a scheduler. When a dependency of aneffectchanges, it is added to a queue and the scheduler decides when is the best time to flush the queue. By default, the queue is flushed with a DARTVM microtask which runs on the next loop; this can be changed by setting a custom scheduler. Flutter comes with its own scheduler, so it is recommended to use flutter's scheduler when using beacons in a flutter app. This can be done by callingBeaconScheduler.useFlutterScheduler();in themainfunction. -
BufferedCountBeacon<
T> - A beacon that exposes a buffer of values that have been added to it.
-
BufferedTimeBeacon<
T> - A beacon that exposes a buffer of values that have been added to it based on a timer.
-
DebouncedBeacon<
T> - A beacon that debounces updates to its value.
- Disposable
- An abstract class that provides a contract for disposing resources.
-
FilteredBeacon<
T> - A beacon that filters updates to its value based on a function.
-
FutureBeacon<
T> -
See
Beacon.future -
IScopedRef<
T> - A ScopedRef is a reference that needs a context to access the instance.
-
ListBeacon<
E> - A beacon that holds a list of values.
- LiteRefScope
- Dependency injection of ScopedRefs.
- LoggingObserver
- A beacon observer that logs to the console.
-
MapBeacon<
K, V> - A beacon that holds a map of values.
-
PeriodicBeacon<
T> - A beacon that emits values periodically.
-
Producer<
T> - The base class for all beacons.
-
ProgressBeacon<
T> - A beacon that emits values periodically with progress information.
-
RawStreamBeacon<
T> - See: Beacon.rawStream()
-
ReadableBeacon<
T> - An immutable beacon.
- Ref
- abstract class for creating refs.
-
ScopedFamilyRef<
T, F> - A ScopedFamilyRef is a reference that needs a context to access instances.
-
ScopedObject<
T> -
A ScopedObject is a reference that holds an instance of
T. -
ScopedRef<
T> - A ScopedRef is a reference that needs a context to access the instance.
-
SetBeacon<
E> - A beacon that holds a set of values.
-
SingletonRef<
T> - A SingletonRef is a reference that always returns a new instance.
-
StreamBeacon<
T> - See: Beacon.stream()
- TextEditingBeacon
- A beacon that wraps a TextEditingController.
-
ThrottledBeacon<
T> - A beacon that throttles updates to its value.
-
TimestampBeacon<
T> - A beacon that attaches a timestamp to its value.
-
TransientRef<
T> - A TransientRef is a reference that always return a new instance.
-
UndoRedoBeacon<
T> - A beacon that allows undo/redo operations.
-
WritableBeacon<
T> - A beacon that can be written to.
Enums
- ProgressStatus
- The status of a ProgressBeacon.
Mixins
-
BeaconControllerMixin<
T extends StatefulWidget> - A mixin that automatically disposes all beacons created by this Widget.
Extensions
- BeaconControllerSelectExt on C
- Extensions that provide a more convenient way to watch the beacons in a BeaconController instance.
-
BoolUtils
on WritableBeacon<
bool> - FlutterBeaconGroupx on BeaconGroup
- Flutter extensions on BeaconGroup
-
IntUtils
on WritableBeacon<
T> -
ListUtils
on List<
T> -
LiteRefBeaconControllerExt
on ScopedRef<
C> - Extensions for ScopedRef that provide a more convenient way to watch the beacons in a BeaconController instance.
-
LiteRefBeaconExt
on ScopedRef<
ReadableBeacon< T> > - Extensions for ScopedRef that provide a more convenient way to watch a ReadableBeacon.
-
ReadableAsyncBeaconUtils
on ReadableBeacon<
AsyncValue< T> > -
ReadableBeaconFlutterUtils
on ReadableBeacon<
T> -
ReadableBeaconUtils
on ReadableBeacon<
T> -
ReadableBeaconWrapUtils
on ReadableBeacon<
T> -
StreamUtils
on Stream<
T> -
WidgetUtils
on BaseBeacon<
T> - @macro WidgetUtils
-
WritableAsyncBeacon
on WritableBeacon<
AsyncValue< T> > -
WritableBeaconFlutterUtils
on WritableBeacon<
T> - @macro WritableBeaconFlutterUtils
-
WritableBeaconUtils
on WritableBeacon<
T> -
WritableWrap
on BeaconWrapper<
T, U>
Constants
- Beacon → const _BeaconCreator
- Global beacon creator
Typedefs
-
AsyncFactory<
T> = Future< T> Function() -
A function that creates an instance of
Tasynchronousloy. -
BaseBeacon<
T> = Producer< T> - The BaseBeacon type. Alias for Producer.
-
BeaconSelector<
T, C> = ReadableBeacon< T> Function(C) - A function that takes a BeaconController and returns 1 of its beacon.
-
BeaconSelector2<
T1, T2, C> = (ReadableBeacon< T1> , ReadableBeacon<T2> ) Function(C) - A function that takes a BeaconController and returns a record of 2 of its beacons.
-
BeaconSelector3<
T1, T2, T3, C> = (ReadableBeacon< T1> , ReadableBeacon<T2> , ReadableBeacon<T3> ) Function(C) - A function that takes a BeaconController and returns a record of 3 of its beacons.
-
CtxCreateFn<
T> = T Function(BuildContext context) -
The function used to create an instance of
T. -
CtxFamilyCreateFn<
T, F> = T Function(BuildContext context, F family) -
The function used to create an instance of
Twith a familyF. -
DisposeFn<
T> = void Function(T) - The function called when the IScopedRef is disposed.
-
ObserverCallback<
T> = void Function(T prev, T next)