getOrNull method

Future<T?> getOrNull()

get this entity, but return null if an exception is thrown (most commonly indicating the entity does not exist).

Implementation

Future<T?> getOrNull() async {
  try {
    return await get();
  } on Exception {
    return null;
  }
}