findProperty<T> static method

ModelProperty<T> findProperty<T>(
  1. BuildContext context,
  2. Symbol key
)

Find the property of the given type from the context. Throws an assertion error if the data is not found.

  • T The type of the data.
  • context The build context.
  • key The data key.

Implementation

static ModelProperty<T> findProperty<T>(BuildContext context, Symbol key) {
  final model = maybeFindProperty<T>(context, key);
  assert(model != null, 'No Model<$T>($key) found in context');
  return model!;
}