flutter_data 2.0.0
flutter_data: ^2.0.0 copied to clipboard
The seamless way to work with persistent data models in Flutter. Inspired by Ember Data and ActiveRecord.
Changelog #
2.0.0-rc2 April 24th, 2024 #
- New version based on
sqlite3
1.5.14 September 22nd, 2023 #
- Fix: all-watchers should be non-nullable, consistent with non-nullable all-finders
- Chore: Dependency upgrades
1.5.13 August 16th, 2023 #
- Fix: Flush Hive on relationship save
1.5.12 June 16th, 2023 #
- Feature: Optionally prevent client closing in
sendRequest - Fix: builder to support
DataModelMixin - Fix: guards and test for uninitialized models
1.5.11 June 15th, 2023 #
- Feature: Introduce
DataModelMixin - Fix: Offline retries failures on reinitialization
- Fix: Bug in local storage destroy method
- Fix: findAll should not be nullable
1.5.10 April 26th, 2023 #
withKeyOfbug with Freezed classes fixed
1.5.9 April 20th, 2023 #
- Support non-JSON responses, use content type if present
- Handle HTTP 304
- Improve graph compacting
withKeyOfbugfix (#218)
1.5.8 March 17th, 2023 #
- Move graph clearing to standalone
compact()function
1.5.7 March 15th, 2023 #
- Make localAdapter findAll non-nullable again
- Remove keys in graph when calling
clear, deleteAll extension - Upgrade dependencies
1.5.6 March 3rd, 2023 #
- Upgrade dependencies
1.5.5 March 2nd, 2023 #
- Allow overriding
LocalAdapter(useful for Hive migrations by overridingdeserialize) - Support Flutter web again (thanks @ariejan)
sendRequestsupports binary data
1.5.4 December 23rd, 2022 #
- Fix and improve clear watcher updates
1.5.3 December 22nd, 2022 #
- Local findAll only return null if not touched and empty
- Clear should also notify watchers
1.5.2 December 7th, 2022 #
- Offline auto-retry and other improvements
1.5.1 December 1st, 2022 #
- Gracefully recover from corrupt boxes (LocalStorageClearStrategy.whenError)
- Fix key overrides (issue #180)
- Relax dependency constraints so it can be used with dart 2.17
1.5.0 November 22nd, 2022 #
- Upgrade dependencies, including Riverpod 2.x
- Improve offline
1.4.7 July 29th, 2022 #
- Improve internal types to fix an issue with release mode on web
- Ensure we always get a key initializing the provider
- Ignore and delete malformed offline operations
1.4.6 July 6th, 2022 #
- Allow passing hive typeIds manually
- Make graph throttle duration zero for tests
- More documentation, tests and coverage
1.4.4 June 6th, 2022 #
- Revert (temporarily) request ordering
- Clean up
1.4.3 June 3rd, 2022 #
- Ordered requests feature: if a previous request arrives later it won't be saved in local storage
- Models are always automatically initialized and never automatically saved
- Reorganized and cleaned up
DataModelAPI
1.4.2 June 1st, 2022 #
- Hotfix: revert 9854a590fca5f73063636750911fe63bd4327f79
1.4.1 June 1st, 2022 #
- Allow easier overriding of
init - Improved logging
1.4.0 May 28th, 2022 #
initis no longer by default required (can be switched off viaautoInitializeModels)- Everything is now only accessed via
ref.$model - Support for
backgroundloading - New labels API to log and track requests, multiple log levels, nested labels
- New
finderAPI to supply an alternative finder to watchers (ex strategies) - Lots of improvements to serialization including async API for
serialize,deserialize), introduced thewithRelationshipsflag toserialize - Allow graph notifier to be throttled via the new
graphNotifierThrottleDurationProvider - Improved
alsoWatchAPI, can now watch any arbitrary relationship in the graph OnSuccess/OnErrorcallback APIsgetIdForKeywill now returnintIDs when appropriate- Bug fix: invoking two notifiers with equal arguments will now always yield the same cached notifier
- Misc bug fixes and performance improvements, builder fixes, test improvements
- Upgrade dependencies and use new lints
1.3.4 #
- Revamp some internal dependency management & testing pipes
- Removed
test.data.dart(will soon add documentation to test FD-driven apps) - Fix
Relationshipequality
1.3.3 #
- Fix
DataModel#notifiergetter - Fix #148 where models from local storage would be returned without relationships
1.3.2 #
- Support Hive
LazyBoxfake intest.data.dart
1.3.0 #
- Introduce API to create custom fetching and watching strategies in order to develop and reuse providers within adapters; and in this spirit, remove
Repository#watchOneNotifierandRepository#watchAllNotifier - Fix broken reload when using functional notifier extensions
- Snake case box names without breaking existing
- Ability for a model to access its
notifier - Fix path on Windows
1.2.1 #
- Fix using wrong name for relationships with multiple words in local storage
- Add
relationships()API; fixwatch()
1.2.0 #
- Fix issue #141 with
remote=falseby default - Allow nullable relationships in
alsoWatch - Replace
dynamicforObject? - Make some
RemoteAdaptermethods public - Notify in graph if saving with
remote=false - Fix issue with inverse relationships in Freezed
- Add experimental model watch API
1.1.1 #
- Fix providers omission in test.data.dart
1.1.0 #
- Upgrade dependencies to latest
- Simplify example app
- Fixed #125: Error when disposing repositories during tests
- Fixed #131: Allow late final relationships in models for better defaults
- Relationships are no longer collections due to upgrade in Freezed
1.0.1 #
- Add adapter shortcuts
- Remove DataModel#watch
- Improve null deserialization handling
1.0.0 #
- Add syntax sugar for repository methods and watchers accessible via
ref.$type - Add
where/mapfunctional extensions onDataStateNotifier(can use instead offilterLocalwhich was removed) - Make
RelationshipaSetagain, allIterablemethods available on it - Improve relationship removal via
BelongsTo.remove()andHasMany.remove() - Upgrade Riverpod to 1.0.0 and Freezed to 1.0.0
- Fix for multiple
doneLoadingevents
0.8.2 #
- Throttle workaround, remove value notifier
- Update dependencies
0.8.1 #
baseDirFnfor web bugfix- Fix watchers dispose, remove forEach extension
- Add filterLocal and syncLocal to watchers
- Ensure model is persisted even if already initialized
- Allow bool save in DataModel
init - Fix minor issue serialization
- Improve tests around serialization edge cases
0.8.0 - 2021-06-21 #
- Migrate to null safety
0.7.2 - 2021-06-09 #
- Upgrade offline operations design
- Fix graph persistence issues
- Notifier
throttlehelper now takes aDuration Function()argument - Make
syncLocal=falsethe default - Fix flashing screen with
filterLocal - Misc watcher fixes
- Update logging style
0.7.1 - 2021-05-27 #
- Offline support for all types of requests, including ad-hoc requests via
sendRequest - Fix
typeIdmanagement and issues aroundclear - Fix graph persistence issues
- Initialize graph externally (codegen)
- Remove
clearAll(use generatedrepositoryProviders+clearfor each one) - Fix bugs related to
types, internal types - Misc utils fixes
0.7.0 - 2021-04-20 #
- Fix singular/plural types, fix remote default
- Allow specifying remote default value via
@DataRepository - Allow
typeto be overridable - Implemented offline-supporting APIs:
offlineSaved,offlineDeleted,offlineSync,offlineClear - Offline handling in
watchAll,watchOneandsave - Fix
addInverseissue - Fix initialization issues
- Make relationship collection-like, rework equality, fixes #88
- Improvements to
data_state - Restore functional
sendRequestAPI, addEtype param - Unify adapters into one main adapter graph and sort, closes #78
- Remove
ProviderandGetItbuilt-in support, can easily be done with documented extensions
0.6.3 - 2021-03-12 #
- Fix
test.data.dartimports
0.6.2 - 2021-03-12 #
- Fix type issues
0.6.1 - 2021-03-12 #
- Add inverses to initialized belongsto relationships
- Support
onErroronsave - Notifier
updateWithfeature
0.6.0 - 2021-03-11 #
- Add
syncLocalandfilterLocalfeatures - Make
saveoptimistic - Use default headers & params by default in
sendRequest - Include
data_statepackage within Flutter Data, upgrade others - Fix bug with related model updates in
alsoWatch - Fix initialization and refresh issues
- Fix empty response handling
- Fix URI helpers broken on web
0.5.20 - 2020-12-06 #
- Allow specifying remoteType (useful for the JSON:API adapter)
0.5.19 - 2020-12-04 #
- Always return Riverpod
StateNotifierProviders (notStateNotifierStateProviders)
0.5.18 - 2020-11-30 #
- repositoryInitializerProvider is now fully restartable via riverpod ref.container.refresh
- if can't channel error through notifier then throw
0.5.17 - 2020-11-16 #
- fix watchAll event handling
0.5.16 - 2020-11-13 #
- add testing support
0.5.15 - 2020-11-11 #
- fix onError callback
- guard onDispose with ref.mounted
0.5.14 - 2020-11-11 #
- fix faulty data_state
0.5.13 - 2020-11-11 #
- TODO since 0.5.9
0.5.8 - 2020-10-22 #
- fix clearAll
0.5.4 - 2020-09-28 #
- Upgrade dependencies
- Fix clearing boxes
- Fix
fieldForKey/keyForFieldin attributes
0.5.3 - 2020-09-16 #
- Upgrade to Riverpod 0.10.x
0.5.2 - 2020-08-20 #
- Upgrade to Riverpod 0.6.x
0.5.1 - 2020-08-19 #
- Allow passing a repository to init() and generate dartdoc
- Expose adapter in DataModel, useful for extensions
- [bugfix] Adapter codegen related to models with a DataModel parent
- [bugfix] Type to string camelCase issue
- [internals] Simplify local storage
0.5.0 - 2020-07-29 #
- Riverpod support
get_itsupport- Flutter Web support
- Self-reference relationship support
DataSupportis nowDataModeland it's a mixin- Redesign and reorganization for more API stability
- New
httpClientandsendRequestfor custom endpoints - Default params & headers now called
defaultParamsanddefaultHeaders - JSON serializer adapter is now included by default
- Move
JSONAPIAdapterto separate package - Expose graph API to external adapters
- Tons of small issues fixed
- 90%+ test coverage
- Dart docs
0.4.2-dev.2 - 2020-06-29 #
- New serializer API with
DeserializedData - Adapt, fix & merge
StandardJSONAdapterinto core, no longer required as adapter - New
DataSupport#init(manager, key, save)API shouldLoadRemoteAll,shouldLoadRemoteOneAPIs- Misc optimizations
- Test infrastructure fixes
0.4.2-dev.1 - 2020-06-24 #
- Throttle graph events, configure duration via
throttleDurationofWatchAdapter - Namespaced graph for custom adapters wanting to leverage graph capabilities
- JSON API adapter fixes
- Removed
DataSupportMixin: onlyDataSupportleft, can be used as class or mixin - Possible to leave models uninitialized (i.e. empty models used in forms)
DataSupport#save,DataSupport#watch,DataSupport#deletewill auto-initialize- Misc fixes and vastly improved
watch*tests
0.4.1 - 2020-06-18 #
- Stabilize API (including
data_stateupgrade) - Ensure to reset exceptions in
watchOnebugfix DataSupportMixinmanualinitnow takes aDataManagerargument- Clean up and minor fixes/additions in tests
0.4.0 - 2020-06-15 #
- Flutter Data is now Adapter-based from the core
- New engine powering relationships and metadata, based on a persitent graph notifier
- Configurable inverses via
@DataRelationship - Notifiers and
watching APIs vastly improved,alsoWatch, allow to work without IDs DataSupportnow hasreload,watch,delete(that can also work without IDs)- Revamped JSON adapters;
fieldForKeyAPI - De-pollute models (only carries a
_flutterDataMetadatamap) - Remove
IdDataSupportfor Freezed, no longer needed - Use
Sets for relationships - Relationships MUST be final
- Upgrade
data_state: ^0.3.0andjson_api: ^4.2.1, droprxdart - Massive testing improvements
0.3.12 - 2020-05-04 #
- new
repositoryForAPI, useful for serialization adapters - JSON:API adapter includes bugfix
Repository#dumpLocalto dump the contents of this repository local storageRepository#remoteflag (closes #30)- verbose flag (closes #18)
- allow passing Hive AES encryption key (closes #29)
0.3.11 - 2020-04-29 #
- new urlFor* API
- default params (closes #27)
- normalize params/headers
- delete keys when deleting models
- minor API fixes
0.3.10 - 2020-04-24 #
- builder hotfix
0.3.9 - 2020-04-24 #
- revamped URL design
- fix API consistency
- misc fixes
0.3.8 - 2020-04-23 #
- add toJson support for different freezed kinds
- improved query parameters
- improved docs
0.3.7 - 2020-04-23 #
- fix dependency issues
- Make
json_serializableoptional - Make type arguments in adapters optional
0.3.6 - 2020-04-22 #
- Generate
dataProvidersonly if 'provider' is a dependency
0.3.5 - 2020-04-22 #
- Optional
fromJson/toJson
0.3.4 - 2020-04-21 #
- Package fixes and documentation
0.3.2 - 2020-04-19 #
- Make linter and pana happy
0.3.1 - 2020-04-19 #
- Release to pub
0.3.0 - 2020-04-06 #
- Revamp serialization system
- Added standard json and JSON:API adapters
- Better relationship support
0.2.0 - 2020-04-04 #
- Auto/manual model initialization modes
- Allow nullable relationships
- Misc refactoring
- More test coverage
0.1.3 - 2020-04-01 #
- Allow
DataIdto holdnullIDs and save ID-less models - Fix relevant unit & integration tests
0.1.2 - 2020-03-31 #
- Fix
alsoAPI inDataManagerXextension - Improve tests
0.1.1 - 2020-03-31 #
- Initial commit