read<T> method

  1. @override
T read<T>({
  1. bool allowUninitialized = false,
})
override

T will find an instance saved under that class in the environment. Will throw an error if none can be found.

Implementation

@override
T read<T>({bool allowUninitialized = false}) {
  if (!initialized && !allowUninitialized) {
    throw ArgumentError(
      'This test environment must be initialized before it is used!',
    );
  }

  return _initializedMap[T] as T;
}