of<T> static method

T of<T>(
  1. BuildContext context
)

Find and listen to data changes of the data with the given type from the context.

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

Implementation

static T of<T>(BuildContext context) {
  final data = maybeOf<T>(context);
  assert(data != null, 'No Data<$T> found in context');
  return data!;
}