From 3c9405be19b52d5bee6f21a33d46abbf09f12c04 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 10 May 2024 14:14:17 -0300 Subject: [PATCH] rename watch providers --- lib/src/adapter/watch_adapter.dart | 10 +++++----- test/repository/remote_adapter_watch_test.dart | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/src/adapter/watch_adapter.dart b/lib/src/adapter/watch_adapter.dart index 6262402a..9abfd408 100644 --- a/lib/src/adapter/watch_adapter.dart +++ b/lib/src/adapter/watch_adapter.dart @@ -49,7 +49,7 @@ mixin _WatchAdapter> on _RemoteAdapter { String? finder, DataRequestLabel? label, }) { - final provider = watchOneProvider( + final provider = watchOneProviderById( model, remote: remote, params: params, @@ -89,7 +89,7 @@ mixin _WatchAdapter> on _RemoteAdapter { AlsoWatch? alsoWatch, String? finder, DataRequestLabel? label}) { - return internalWatch!(watchOneProvider( + return internalWatch!(watchOneProviderById( model, remote: remote, params: params, @@ -473,7 +473,7 @@ mixin _WatchAdapter> on _RemoteAdapter { }); AutoDisposeStateNotifierProvider, DataState> - watchOneProvider( + watchOneProviderById( Object model, { bool remote = false, Map? params, @@ -489,7 +489,7 @@ mixin _WatchAdapter> on _RemoteAdapter { .whereType() .toImmutableList(); - return _watchOneProvider( + return watchOneProvider( WatchArgs( key: key, remote: remote, @@ -503,7 +503,7 @@ mixin _WatchAdapter> on _RemoteAdapter { ); } - late final _watchOneProvider = StateNotifierProvider.autoDispose + late final watchOneProvider = StateNotifierProvider.autoDispose .family, DataState, WatchArgs>((ref, args) { return _watchOneNotifier( args.key!, diff --git a/test/repository/remote_adapter_watch_test.dart b/test/repository/remote_adapter_watch_test.dart index 28121f9e..e32a86b5 100644 --- a/test/repository/remote_adapter_watch_test.dart +++ b/test/repository/remote_adapter_watch_test.dart @@ -475,7 +475,7 @@ void main() async { final defaultNotifier = container.bookAuthors.watchOneNotifier(1); final capsNotifier = container.read(container.bookAuthors - .watchOneProvider(bookAuthor, finder: 'caps') + .watchOneProviderById(bookAuthor, finder: 'caps') .notifier); final capsNotifier2 = @@ -496,7 +496,8 @@ void main() async { // similar tests without IDs final p = Person(name: 'Daniel'); final p2 = Person(name: 'Bobby'); - final pn1 = container.read(container.people.watchOneProvider(p).notifier); + final pn1 = + container.read(container.people.watchOneProviderById(p).notifier); final pn1b = container.people.watchOneNotifier(p); final pn2 = container.people.watchOneNotifier(p2); expect(pn1, equals(pn1b));