lookupOrNull<T extends Model> method

Future<T?> lookupOrNull<T extends Model>(
  1. Key key
)

Looks up a single key in the datastore, and returns the associated Model object.

If the key is not found in the datastore, null will be returned.

Implementation

Future<T?> lookupOrNull<T extends Model>(Key key) async {
  final values = await lookup<T>(<Key>[key]);
  assert(values.length == 1);
  return values.single;
}