of method

T of(
  1. BuildContext context, {
  2. bool rebuildOnChange = false,
})

Returns the Model of type T of the closest ancestor ScopedModel.

Widgets who call of with a rebuildOnChange of true will be rebuilt whenever there's a change to the returned model.

Implementation

T of(BuildContext context, {bool rebuildOnChange = false}) {
  return ScopedModel.of<T>(context, rebuildOnChange: rebuildOnChange);
}