change_emitter library

A flexible, composable alternative to ChangeNotifier for Flutter state management.

Classes

Change
An immutable class used by ChangeEmitters to trigger UI or other components of your state to update.
ChangeEmitter<C extends Change>
An alternative to ChangeNotifier from the Flutter framework that exposes a stream of Changes to notify widgets and other components of your state that they should update instead of a list of callbacks. This allows ChangeEmitters to provide extra information about individual changes and makes them more easily composable.
ChangeWithAny
ContainerChange
A Change used by EmitterContainer to notify listeners whenever a child element (see EmitterContainer.children) changed or EmitterContainer.emit is called.
EmitterContainer<C extends ContainerChange>
A ChangeEmitter that can be subclassed in order to compose multiple ChangeEmitters into a single unit. To use, simply define any ChangeEmitters you need in your class and override the children getter with a complete list of all of them. This will dispose all children when the container is disposed and will trigger the container to emit a change whenever any of the children changes
EmitterList<E extends ChangeEmitter<Change>>
A ListEmitter that can only contain ChangeEmitters. EmitterList will automatically dispose elements that get removed from the list and all remaining elements in the list when it is disposed.
ListChange<E>
A Change emitted by ListEmitter. If ListEmitter.emitDetailedChanges is set to true, will provide a list of ListModifications. Otherwise, will recycle the same cached new ListChange.any object to minimize garbage collection.
ListEmitter<E>
A ChangeEmitter implementation of a list. Modifying the list will not cause it to emit changes. When you would like the list to emit changes, call emit. This lets you perform multiple changes to a list before updating your UI or other parts of state. Calling emit will not emit changes if there have been no changes.
ListModification<E>
A single atomic modification on a ListEmitter. Can be an insert, a remove or replace at a particular index.
MapChange<K, V>
A Change emiited by MapEmitter. If MapEmitter.emitDetailedChanges is set to true, will provide a list of MapModifications. Otherwise, will recycle the same cached new ListChange.any object to minimize garbage collection.
MapEmitter<K, V>
A ChangeEmitter implementation of a map. Modifying a MapEmitter won't automatically emit a change. To emit a change after it has been modified, call emit.
MapModification<K, V>
An individual modification, either an insert, remove or both (see isInsert, isRemove, isReplace).
OffsetChange
OffsetEmitter
ParentEmitter<C extends Change>
Provider<T extends ChangeEmitter<Change>>
Reprovider<T extends ChangeEmitter<Change>, S extends ChangeEmitter<Change>>
RootEmitter<C extends ContainerChange>
ScrollEmitter
TextEditingEmitter
A ChangeEmitter that lets you read values from and control a TextField. To use, provide the TextField with the controller property. The controller will be disposed when this is disposed. Should only be used with one TextField at a time.
ValueChange<T>
A Change emitted by ValueEmitter. If ValueEmitter.emitDetailedChanges is set to true, will provide both the new value and the old value being replaced. Otherwise, will recycle the same cached new ValueChange.any object to minimize garbage collection.
ValueEmitter<T>
A simple ChangeEmitter that stores a value, emits a ValueChange whenever the value changes.