extension<T extends Object> static method

T extension<T extends Object>(
  1. BuildContext context
)

Like maybeExtension, but throws a StateError when no extension matches.

Implementation

static T extension<T extends Object>(BuildContext context) {
  final extension = maybeExtension<T>(context);
  if (extension == null) {
    throw StateError('No Fleury app extension of type $T found in context.');
  }
  return extension;
}