get<O extends Object> method

O get<O extends Object>()

Implementation

O get<O extends Object>() {
  final O? obj = _objects.values.whereType<O>().firstOrNull;
  if (obj == null) {
    throw StateError('Object of type $O not found in context');
  }
  return obj;
}