contextOf<T extends Object?> static method

T contextOf<T extends Object?>(
  1. BuildContext context, {
  2. String? id,
  3. ListenStates<T>? listenStates,
  4. bool listen = true,
})

Returns an instance of T and sets the BuildContext to listen for when it should be re-rendered.

Implementation

static T contextOf<T extends Object?>(
  BuildContext context, {
  String? id,
  ListenStates<T>? listenStates,
  bool listen = true,
}) =>
    ProvideImpl.contextOf<T>(
      context,
      id: id,
      listenStates: listenStates,
      listen: listen,
    );