fromMap static method

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

Implementation

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

  var memberActionsFromMap = map['memberActions'];
  List<MemberActionEntity> memberActionsList;
  if (memberActionsFromMap != null) {
    memberActionsList = (map['memberActions'] as List<dynamic>)
        .map((dynamic item) => MemberActionEntity.fromMap(item as Map,
            newDocumentIds: newDocumentIds)!)
        .toList();
  } else {
    memberActionsList = [];
  }
  var conditionsFromMap = map['conditions'];
  if (conditionsFromMap != null) {
    conditionsFromMap = StorageConditionsEntity.fromMap(conditionsFromMap,
        newDocumentIds: newDocumentIds);
  }

  return FollowRequestsDashboardEntity(
    appId: map['appId'],
    description: map['description'],
    memberActions: memberActionsList,
    conditions: conditionsFromMap,
  );
}