getInstance<T> method

T getInstance<T>()

Creates an instance using one of the constructors

Will throw an ArgumentError if one isn't present in constructors for T

Implementation

T getInstance<T>() {
  if (!constructors.containsKey(T)) {
    throw ArgumentError(
        '$T was not added to the constructors of this FakeDatabaseRepository.'
        ' Please ensure you add all constructors you want to use for each '
        'type you will use.');
  }
  return constructors[T]!() as T;
}