getCachedEntityByMapID<O> method

  1. @override
O? getCachedEntityByMapID<O>(
  1. Map<Object?, Object?> map, {
  2. Type? type,
})
override

Returns a cached entity of type with an id from map entries. See getEntityIDFromMap.

Implementation

@override
O? getCachedEntityByMapID<O>(Map<Object?, Object?> map, {Type? type}) {
  var id = getEntityIDFromMap(map, type: type);
  if (id != null) {
    var cachedEntity = getCachedEntityByID(id, type: type);
    if (cachedEntity != null) {
      return cachedEntity as O;
    }
  }
  return null;
}