Skip to content

Commit 3c9405b

Browse files
committed
rename watch providers
1 parent e54a2e5 commit 3c9405b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/src/adapter/watch_adapter.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ mixin _WatchAdapter<T extends DataModelMixin<T>> on _RemoteAdapter<T> {
4949
String? finder,
5050
DataRequestLabel? label,
5151
}) {
52-
final provider = watchOneProvider(
52+
final provider = watchOneProviderById(
5353
model,
5454
remote: remote,
5555
params: params,
@@ -89,7 +89,7 @@ mixin _WatchAdapter<T extends DataModelMixin<T>> on _RemoteAdapter<T> {
8989
AlsoWatch<T>? alsoWatch,
9090
String? finder,
9191
DataRequestLabel? label}) {
92-
return internalWatch!(watchOneProvider(
92+
return internalWatch!(watchOneProviderById(
9393
model,
9494
remote: remote,
9595
params: params,
@@ -473,7 +473,7 @@ mixin _WatchAdapter<T extends DataModelMixin<T>> on _RemoteAdapter<T> {
473473
});
474474

475475
AutoDisposeStateNotifierProvider<DataStateNotifier<T?>, DataState<T?>>
476-
watchOneProvider(
476+
watchOneProviderById(
477477
Object model, {
478478
bool remote = false,
479479
Map<String, dynamic>? params,
@@ -489,7 +489,7 @@ mixin _WatchAdapter<T extends DataModelMixin<T>> on _RemoteAdapter<T> {
489489
.whereType<RelationshipMeta>()
490490
.toImmutableList();
491491

492-
return _watchOneProvider(
492+
return watchOneProvider(
493493
WatchArgs(
494494
key: key,
495495
remote: remote,
@@ -503,7 +503,7 @@ mixin _WatchAdapter<T extends DataModelMixin<T>> on _RemoteAdapter<T> {
503503
);
504504
}
505505

506-
late final _watchOneProvider = StateNotifierProvider.autoDispose
506+
late final watchOneProvider = StateNotifierProvider.autoDispose
507507
.family<DataStateNotifier<T?>, DataState<T?>, WatchArgs<T>>((ref, args) {
508508
return _watchOneNotifier(
509509
args.key!,

test/repository/remote_adapter_watch_test.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ void main() async {
475475
final defaultNotifier = container.bookAuthors.watchOneNotifier(1);
476476

477477
final capsNotifier = container.read(container.bookAuthors
478-
.watchOneProvider(bookAuthor, finder: 'caps')
478+
.watchOneProviderById(bookAuthor, finder: 'caps')
479479
.notifier);
480480

481481
final capsNotifier2 =
@@ -496,7 +496,8 @@ void main() async {
496496
// similar tests without IDs
497497
final p = Person(name: 'Daniel');
498498
final p2 = Person(name: 'Bobby');
499-
final pn1 = container.read(container.people.watchOneProvider(p).notifier);
499+
final pn1 =
500+
container.read(container.people.watchOneProviderById(p).notifier);
500501
final pn1b = container.people.watchOneNotifier(p);
501502
final pn2 = container.people.watchOneNotifier(p2);
502503
expect(pn1, equals(pn1b));

0 commit comments

Comments
 (0)