lookup<T> method

EntitySupport<T> lookup<T>([
  1. Type? type
])

Lookup the EntitySupport for a type.

Implementation

EntitySupport<T> lookup<T>([Type? type]) {
  var support = entries[type ?? T];
  if (support == null) {
    throw 'No registry entry found for ${type ?? T}. To fix this:\n'
        ' 1. Make sure the class is annotated with @entity\n'
        ' 2. Make sure box_generator is added to dev_dependencies in pubspec.yaml\n'
        ' 3. Run "pub run build_runner build" again'
        ' 4. Add the generated Box support to the registry: Registry()..register(${type ?? T}\$BoxSupport())';
  }
  return support as EntitySupport<T>;
}