watchOneProvider method

AutoDisposeStateNotifierProvider<DataStateNotifier<T?>, DataState<T?>> watchOneProvider(
  1. Object model, {
  2. bool? remote,
  3. Map<String, dynamic>? params,
  4. Map<String, String>? headers,
  5. AlsoWatch<T>? alsoWatch,
  6. String? finder,
  7. DataRequestLabel? label,
})

Implementation

AutoDisposeStateNotifierProvider<DataStateNotifier<T?>, DataState<T?>>
    watchOneProvider(
  Object model, {
  bool? remote,
  Map<String, dynamic>? params,
  Map<String, String>? headers,
  AlsoWatch<T>? alsoWatch,
  String? finder,
  DataRequestLabel? label,
}) {
  final key = remoteAdapter.keyForModelOrId(model);

  remote ??= remoteAdapter._remote;
  final relationshipMetas = alsoWatch
      ?.call(RelationshipGraphNode<T>())
      .whereType<RelationshipMeta>()
      .toImmutableList();

  return _watchOneProvider(
    WatchArgs(
      key: key,
      remote: remote,
      params: params,
      headers: headers,
      relationshipMetas: relationshipMetas,
      alsoWatch: alsoWatch,
      finder: finder,
      label: label,
    ),
  );
}