fromMap static method
Implementation
static AppPolicyEntity? fromMap(Object? o,
{Map<String, String>? newDocumentIds}) {
if (o == null) return null;
var map = o as Map<String, dynamic>;
var policyIdNewDocmentId = map['policyId'];
if ((newDocumentIds != null) && (policyIdNewDocmentId != null)) {
var policyIdOldDocmentId = policyIdNewDocmentId;
policyIdNewDocmentId = newRandomKey();
newDocumentIds[policyIdOldDocmentId] = policyIdNewDocmentId;
}
var conditionsFromMap = map['conditions'];
if (conditionsFromMap != null) {
conditionsFromMap = StorageConditionsEntity.fromMap(conditionsFromMap,
newDocumentIds: newDocumentIds);
}
return AppPolicyEntity(
appId: map['appId'],
name: map['name'],
policyId: policyIdNewDocmentId,
conditions: conditionsFromMap,
);
}