syncx 0.2.1
syncx: ^0.2.1 copied to clipboard
syncx is a lightweight, flexible Flutter state management library with notifiers and reactive UI updates, inspired by provider, bloc, and riverpod.
0.2.1 #
- Fix: The
example/directory was missing from the published archive, so pub.flutter-io.cn reported "No example found" and scored the package 0/10 for having an example. A.pubignorereplaces.gitignorerather than adding to it, and the one added in 0.2.0 excluded the whole example directory instead of only its build output. - Docs: Documented
BuildContextExtensionsandBuildContextExtensions.read, the two public API elements that had no dartdoc comment.
0.2.0 #
- Fix:
listenWhenreceived apreviousvalue that never advanced, so every comparison after the first was made against the state the widget mounted with. It now receives the state immediately before the change it is being asked about. - Fix:
NotifierBuilderandNotifierConsumerkept thechildand thebuilderclosure from the build in which they first rebuilt, so a changedchildor a rebuilt parent could render stale output. - Fix: Replacing the notifier instance provided above a builder, which
NotifierRegister.valueallows, left the widget listening to the old notifier for the rest of its life. - Fix:
buildWhenwas consulted once during the initial build, comparing the initial state against itself, so a predicate with side effects fired before any change had occurred. - Fix:
AsyncNotifiercould notify listeners and overwrite state after disposal whenonInitcompleted late, and anonInitthat failed was swallowed instead of becoming an error state. - Fix: A custom
equalityCheckpassed toAsyncNotifier.setStatewas combined with the default state equality rather than replacing it, so a check reporting "equal, do not update" still updated whenever any other field differed. - Fix: A widget's
onInitcallback could not call a notifier method that updates state synchronously.NotifierRegistersubscribed to the notifier, so a state change during a descendant'sinitStatemarked the provider dirty mid-build and threwsetState() or markNeedsBuild() called during build. The notifier is now provided without being subscribed to, since the builders attach their own listeners. This also removes one listener and one provider rebuild per state change. - Note: Because
NotifierRegisterno longer subscribes to the notifier,context.watch<MyNotifier>()andProvider.of(listen: true)no longer rebuild on state changes. UseNotifierBuilder,NotifierConsumeror their async equivalents, which is what the package documents. - Fix:
AsyncStateequality ignored its type argument, soAsyncState<int>.data(1)equalledAsyncState<num>.data(1)and an update that legitimately changed the state's type could be silently refused. - Enhancement:
stateis now public.context.read<MyNotifier>().statewas previously an analyzer error for every consumer of the package. - Enhancement:
addListenerandremoveListenerare no longer marked protected, so a notifier can be wired to widgets other than SyncX's own. - Docs:
NotifierandAsyncNotifiernow document that dependencies must arrive as initializing formals or through the initializer list, becauseonInitruns before the subclass constructor body. - Docs:
toLoadingandtoErrornow document that the previousdatacarries over and is read through thedatafield, sincewhenandwhenDatabranch on status alone. - Docs: Corrected builder snippets that still showed the pre-0.1.9
(context, state)signature, and twoonUpdateexamples that named the overrideonUpdated. - Internal: 100% line coverage, enforced in CI alongside formatting,
--fatal-infosanalysis and a publish dry run.
0.1.9 #
- BREAKING CHANGE: Modified builder callback signatures from
(context, state)to(state, child)for all widgets (NotifierBuilder,NotifierConsumer,AsyncNotifierBuilder,AsyncNotifierConsumer). This change improves consistency and removes unnecessary context parameter. - Feature: Added new
onUpdatelifecycle API for notifiers to handle state changes and side effects. - Feature: Enhanced async widgets with
.withDataconstructors for cleaner, more readable async state handling. - Feature: Improved
AsyncNotifierBuilder,AsyncNotifierConsumer, andAsyncNotifierListenerwith convenient APIs. - Enhancement: Better type safety and reduced boilerplate for async state management.
- Internal: Performance improvements and code optimizations.
Migration Guide: Update your builder callbacks from:
// Old API (0.0.x)
NotifierBuilder<MyNotifier, MyState>(
builder: (context, state) => Text('$state'),
)
// New API (0.1.0+)
NotifierBuilder<MyNotifier, MyState>(
builder: (state, child) => Text('$state'),
)
0.0.97 #
- Fix: Resolved minor bugs
- Features: New Async notifier API's setLoading, setError and setData.
0.0.93 #
- Added and expanded documentation for async widgets (
AsyncNotifierBuilder,AsyncNotifierConsumer,AsyncNotifierListener) and core async state model(AsyncState). - Updated README: clarified async state handling, added examples for new async widgets, and explained their relationship to sync widgets.
- Fix: Notifier builder bug
0.0.83 #
- Updated: Description.
0.0.82 #
- Improved documentation and made minor formatting adjustments.
0.0.81 #
- Improved documentation and made minor formatting adjustments.
0.0.8 #
- Updated: Documentation.
0.0.7 #
- Updated: Documentation patch.
0.0.6 #
- Updated: Documentation for clarity and completeness, including improved usage examples and API explanations.
0.0.5 #
- Updated: Example
0.0.4 #
- Fix: Format
0.0.3 #
- Lowered Dart SDK minimum version to >=2.17.0 for broader compatibility with more Flutter projects.
- Updated pubspec and documentation to reflect compatibility improvements.
0.0.2 #
- Improved async state handling:
AsyncNotifiernow supports asynconInitreturning a Future. - Updated documentation and README for clarity and conciseness.
- Example app refactored for modularity and better demonstration of both sync and async notifiers.
- Minor API and doc improvements for lifecycle mixins and async state.
0.0.1 #
- Initial release of SyncX.
- Notifier-based state management for Flutter.
BaseNotifierandNotifierclasses for state logic.NotifierRegisterfor easy provider integration.NotifierBuilderfor rebuilding UI on state changes.NotifierListenerfor side-effect listening.NotifierConsumerfor combined build and listen.- Fine-grained rebuild/listen control with
buildWhenandlistenWhen. - Full documentation and usage examples.
- MIT License.