of<T extends ChangeNotifier> static method

MinProvider<T> of<T extends ChangeNotifier>(
  1. BuildContext context
)

Static method to get the MinProvider instance from the context, throwing an error if not found.

This method is useful when you are certain that the provider exists in the context and want to ensure access to it. If the provider is not found, an assertion error is thrown.

Implementation

static MinProvider<T> of<T extends ChangeNotifier>(BuildContext context) {
  final MinProvider<T>? result = maybeOf<T>(context);
  assert(result != null, 'No MinProvider found in context for $T');
  return result!;
}