diff --git a/README.md b/README.md index 42dfab4f..4bad4c79 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ ## Persistent reactive models in Flutter with zero boilerplate +### NOTE: 2.0 is unstable, use 1.6.0 for now + Flutter Data is a [local-first](https://www.inkandswitch.com/local-first/) data framework with a customizable REST client and powerful model relationships, built on Riverpod. Inspired by [Ember Data](https://github.com/emberjs/data) and [ActiveRecord](https://guides.rubyonrails.org/active_record_basics.html). diff --git a/lib/src/adapter/watch_adapter.dart b/lib/src/adapter/watch_adapter.dart index 62babc0b..6262402a 100644 --- a/lib/src/adapter/watch_adapter.dart +++ b/lib/src/adapter/watch_adapter.dart @@ -525,6 +525,10 @@ mixin _WatchAdapter> on _RemoteAdapter { DataStateNotifier notifierFor(T model) { return watchOneNotifier(model, remote: false); } + + void triggerNotify() { + core._notify([internalType], type: DataGraphEventType.updateNode); + } } final coreNotifierThrottleDurationProvider = diff --git a/lib/src/model/data_model.dart b/lib/src/model/data_model.dart index a128dbde..4583cc27 100644 --- a/lib/src/model/data_model.dart +++ b/lib/src/model/data_model.dart @@ -34,7 +34,6 @@ mixin DataModelMixin> { String get _internalType => DataHelpers.internalTypeFor(T.toString()); T get _this => this as T; - /// Exposes this type's [Adapter] Adapter get _adapter => _internalAdaptersMap![_internalType] as Adapter; T init() { diff --git a/lib/src/storage/local_storage.dart b/lib/src/storage/local_storage.dart index 841d10bd..15ea3524 100644 --- a/lib/src/storage/local_storage.dart +++ b/lib/src/storage/local_storage.dart @@ -14,12 +14,14 @@ class LocalStorage { final int busyTimeout; late final String path; + late final bool inIsolate; @protected late final Database db; Future initialize({bool inIsolate = false}) async { if (isInitialized) return this; + this.inIsolate = inIsolate; final baseDirPath = await baseDirFn(); path = path_helper.join(baseDirPath, 'flutter_data.db');