Package selection guidance compiled from public package information, community data, and project usage.
RxNotifier is a Flutter/Dart package that extends ValueNotifier with transparent functional reactive programming (TFRP). It enables reactive state management by allowing developers to compose and transform state changes using functional operators, while maintaining the simplicity of ValueNotifier. The package integrates seamlessly into existing Flutter apps, offering a lightweight alternative for managing state with reactive patterns without boilerplate. It supports all major platforms and promotes clean, testable code through immutable updates and stream-like transformations.
Use cases
Reactive UI state updates
Composing complex state logic
Replacing multiple ValueNotifiers
Simplifying state transformation
Building reactive forms
Managing asynchronous state
Key features
Functional reactive programming
Transparent TFRP integration
Immutable state updates
Stream-like operators
Minimal boilerplate
Cross-platform support
Suitable for
Developers seeking reactive state management
Apps needing composable state logic
Teams preferring functional programming
Projects avoiding heavy state managers
Flutter beginners learning reactive patterns
Apps requiring lightweight state solutions
Considerations
Requires understanding of functional programming concepts
May introduce learning curve for beginners
Limited to reactive patterns based on ValueNotifier
Not ideal for very large-scale state management
Best suited for moderate complexity state needs
Does not replace full reactive frameworks like RxDart
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
rx_notifier
The ValueNotifier is a simple, native form of Flutter reactivity.
This extension aims to transparently apply functional reactive programming (TFRP).
It is possible to implement Recoil Atoms pattern using RxNotifier.
This pattern consists of the state being an object with its own reactivity.
Motivation
Developers still have trouble understanding state management in Flutter.
We had this conclusion after several research in the community fluttering and also
in partner companies.
Atomic State is a noob-friendly state management approuch at the same time
that maintains a reliable structure thinking of scalability and maintenance.
We must take into account some architectural limits to execute this Approach:
All states must be an atom(RxNotifier instance).
All actions must be an atom(RxNotifier instance).
Business rules must be created in the Reducer and not in the Atom.
Layers
We will have 3 main layers, they are: Atoms, Reducers and Views;
Note that the View (which is the presentation layer) does not know about the Reducer (which is the business rule execution layer).
These two layers share atoms that in turn represent the state and the dispatch of state actions.
In Flutter these layers translate to Atom(RxNotifier), Reducer(RxReducer) and View(Widget):
Atoms (RxNotifier)
Atom represent the reactive state of an application.
Each atom has its own reactivity.
In this architecture you are forced to split state management
of business rules, which may seem strange at first when seen
that we are always managing and reducing state in the same layer as BLoC and ChangeNotifier for example.
However, dividing state management and business rule execution will help us distribute multiple states to the same widget, and these multiple states will not need to be concatenated beforehand through a facade or proxy.
The layer responsible for making business decisions will be called Reducer:
Reducers can register methods/functions that listen to the reactivity of an Atom(RxNotifier).
View (Widget)
Any widget can listen to changes of one or many atoms,
provided they have the RxRoot widget as their ancestor.
For more details about RxRoot, Read the documentation.
The context.select() method is added via Extension to BuildContext and can be called on any type of Widget, StatefulWidget and StatelessWidget.