fromMap static method

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

Implementation

static FollowingDashboardEntity? 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 FollowingDashboardEntity(
    appId: map['appId'],
    description: map['description'],
    view: map['view'],
    memberActions: memberActionsList,
    conditions: conditionsFromMap,
  );
}