fromMap static method

PayEntity? fromMap(
  1. Object? o, {
  2. Map<String, String>? newDocumentIds,
})

Implementation

static PayEntity? fromMap(Object? o, {Map<String, String>? newDocumentIds}) {
  if (o == null) return null;
  var map = o as Map<String, dynamic>;

  var succeededFromMap = map['succeeded'];
  if (succeededFromMap != null) {
    succeededFromMap = ActionEntity.fromMap(succeededFromMap,
        newDocumentIds: newDocumentIds);
  }
  var payActionFromMap = map['payAction'];
  if (payActionFromMap != null) {
    payActionFromMap = ActionEntity.fromMap(payActionFromMap,
        newDocumentIds: newDocumentIds);
  }
  var conditionsFromMap = map['conditions'];
  if (conditionsFromMap != null) {
    conditionsFromMap = StorageConditionsEntity.fromMap(conditionsFromMap,
        newDocumentIds: newDocumentIds);
  }

  return PayEntity(
    appId: map['appId'],
    description: map['description'],
    succeeded: succeededFromMap,
    payAction: payActionFromMap,
    shopId: map['shopId'],
    conditions: conditionsFromMap,
  );
}