call abstract method

Injected<T> call(
  1. BuildContext context, {
  2. bool defaultToGlobal = false,
})

Obtain the Injected model from the nearest InheritedWidget inserted using inherited.

The BuildContext used, will not be registered.

If you want to obtain the state and register it use the of method.

myModel.of(context); // Will return the state and register the BuildContext.
myModel(context); // Will return the Injected model and do not register the BuildContext.

Implementation

Injected<T> call(BuildContext context, {bool defaultToGlobal = false});