async_phase_notifier 0.5.0 async_phase_notifier: ^0.5.0 copied to clipboard
A variant of ValueNotifier that helps you better manage phases of asynchronous operations.
0.5.0 #
- Breaking:
- Change parameter of
AsyncPhaseNotifier
constructor to be no longer optional. - Change callback of
runAsync()
to no longer receive current data. - Change return type of callback of
runAsync()
fromFutureOr
toFuture
.- This is an improvement to prevent misuse that leads to unhandled error.
- Deprecate
runAsync()
in favour of newupdate()
.
// Before final notifier = AsyncPhaseNotifier<int>(); // After final notifier = AsyncPhaseNotifier<int>(0); // Before class MyNotifier extends AsyncPhaseNotifier<int> { MyNotifier(); } // After class MyNotifier extends AsyncPhaseNotifier<int> { MyNotifier() : super(0); } // Before await runAsync((data) => yourFunc(data)); // After await update(() => yourFunc(data)); // `data` here is a new getter for `value.data`.
- Change parameter of
- Upgrade async_phase to 0.5.0.
- The return type of callback of
AsyncPhase.from()
is nowFuture
instead ofFutureOr
. error
andstackTrace
ofAsyncError
is now non-nullable.- See the change log of package:async_phase for details and non-breaking changes.
- The return type of callback of
- Add
update()
toAsyncPhaseNotifier
as a replacement of deprecatedrunAsync()
. - Add
updateOnlyPhase()
toAsyncPhaseNotifier
, - Add type-safe
data
getter forvalue.data
toAsyncPhaseNotifier
. - Fix
runAsync()
.- Resulting
AsyncError
had stale data if fallback data was not provided andvalue.data
was updated while the callback was executed.
- Resulting
- Some minor improvements.
0.4.3 #
- Upgrade async_phase to 0.4.0.
0.4.2 #
- Improve comments and tests to reduce risk of nullability mistakes.
- Fix and simplify description on nullability of
data
in README. - Update dependencies.
0.4.1 #
- Update dependencies.
copyWith()
added to AsyncPhase at async_phase 0.3.2 is available.
- Add tests for
dispose()
of AsyncPhaseNotifier. - Fix test for
listenFor()
. - Small refactorings.
0.4.0 #
- Breaking changes:
- Rename
listen()
tolistenFor()
. - Add the new
listen()
method.- This method takes a single listener function that receives the latest phase, whereas
listenFor()
takes several callback functions, each of which corresponds to a certain phase.
- This method takes a single listener function that receives the latest phase, whereas
- Rename
0.3.0 #
- Raise minimum Flutter SDK version to 3.10.0.
- Bump async_phase to 0.3.0.
- Related refactorings.
0.2.0+1 #
- Fix description on AsyncPhaseListener.
0.2.0 #
- Breaking changes:
- Change listeners to listen to not only errors but also changes to waiting/complete phases.
- Rename
listenError()
tolisten()
and add callbacks. - Rename
AsyncErrorListener
toAsyncPhaseListener
and add callbacks.BuildContext
is not passed toonError
any more.
- Rename
- Require Flutter 3.7.0 or above.
- Change listeners to listen to not only errors but also changes to waiting/complete phases.
- Add dependency on meta.
- Warn if the result of
listen()
is not used.
0.1.0 #
- Update async_phase to 0.1.0.
- There are some breaking changes.
- Simplify the
value
setter that was needlessly complex and possibly led to wrong behaviours.
0.0.1 #
- Initial version.