nbr 2.0.0 nbr: ^2.0.0 copied to clipboard
Generic implementation of the network-bound-resource algorithm in Dart
0.0.1 #
- Initial version.
0.0.2 #
- Bump Dart SDK version constraint and update dependencies.
0.0.3 #
- Bump Dart SDK version constraint and update dependencies.
0.0.4 #
- Bump Dart SDK version constraint and update dependencies.
1.0.0 #
- GitHub repository cleanup
- Regenerate
analysis_options.yaml
file
1.0.1 #
- Dart 3 ready: new
analysis_options.yaml
file + bumped Dart SDK constraints
1.0.2 #
- Update
analysis_options.yaml
file.
1.0.3 #
shouldFetch
callback has a different signature, it's now defined astypedef ShouldFetchCallback<Entity> = FutureOr<bool> Function(Entity? entity)
instead oftypedef ShouldFetchCallback<Entity> = bool Function(Entity? entity)
2.0.0 #
- This version contains breaking changes.
NetworkBoundResource
- Added
- Implemented use of a
StreamController
to manage the stream ofResource
objects emitted by theNetworkBoundResource
. The stream can be accessed via astream
getter. - Added a
dispose
method to close theStreamController
when theNetworkBoundResource
is no longer needed.
- Implemented use of a
- Changed
- Modified the
fetch
method to use theStreamController
to emitResource
objects representing the current state of the resource. - Updated exception handling in the
fetch
method to emit aResource.failed
object with the caught exception.
- Modified the
- Added
Resource
- Added
- Added a
ResourceStatus
enum to represent the different states a resource can be in. - Added
status
field toResource
to indicate the current state of the resource. - Added
exception
field toResource
to hold an exception if the resource is in thefailed
state.
- Added a
- Changed
- Made
Resource
an immutable class. - Replaced separate subclasses for each resource state (empty, loading, success, failed) with named constructors in the
Resource
class itself. - Renamed
baseData
todata
andbaseException
toexception
for clarity.
- Made
- Added