watch<T extends Listenable?> method

  1. @Deprecated("It is no longer possible to use [watch] by directly specifying [PageRef] or [WidgetRef]. Instead, use [ref.page.watch] or [ref.widget.watch] to specify the scope. [PageRef]や[WidgetRef]を直接指定しての[watch]の利用はできなくなります。代わりに[ref.page.watch]や[ref.widget.watch]でスコープを指定しての利用を行ってください。")
T watch<T extends Listenable?>(
  1. T callback(
    1. QueryScopedValueRef<PageScopedValueRef> ref
    ), {
  2. List<Object> keys = const [],
  3. Object? name,
  4. bool disposal = true,
  5. bool autoDisposeWhenUnreferenced = false,
})

Implementation

@Deprecated(
  "It is no longer possible to use [watch] by directly specifying [PageRef] or [WidgetRef]. Instead, use [ref.page.watch] or [ref.widget.watch] to specify the scope. [PageRef]や[WidgetRef]を直接指定しての[watch]の利用はできなくなります。代わりに[ref.page.watch]や[ref.widget.watch]でスコープを指定しての利用を行ってください。",
)
T watch<T extends Listenable?>(
  T Function(QueryScopedValueRef<PageScopedValueRef> ref) callback, {
  List<Object> keys = const [],
  Object? name,
  bool disposal = true,
  bool autoDisposeWhenUnreferenced = false,
}) {
  return page.getScopedValue<T, _WatchValue<T, PageScopedValueRef>>(
    (ref) => _WatchValue<T, PageScopedValueRef>(
      callback: callback,
      keys: keys,
      ref: page,
      disposal: disposal,
      autoDisposeWhenUnreferenced: autoDisposeWhenUnreferenced,
    ),
    listen: true,
    name: name,
  );
}