MessageSearchOption.fromMap constructor Null safety

MessageSearchOption.fromMap(
  1. Map<String, dynamic> param
)

Implementation

factory MessageSearchOption.fromMap(Map<String, dynamic> param) {
  return MessageSearchOption(
    startTime: param['startTime'] as int,
    endTime: param['endTime'] as int,
    limit: param['limit'] as int,
    order: (param['order'] as String?) == 'DESC'
        ? SearchOrder.DESC
        : SearchOrder.ASC,
    msgTypeList: (param['messageTypeList'] as List<dynamic>?)
        ?.map((e) => NIMMessageTypeConverter().fromValue(e))
        .toList(),
    messageSubTypes: (param['messageSubTypes'] as List<dynamic>?)
        ?.map((e) => e as int)
        .toList(),
    allMessageTypes: param['allMessageTypes'] as bool?,
    searchContent: param['searchContent'] as String?,
    fromIds: (param['fromIds'] as List<dynamic>?)
        ?.map((e) => e.toString())
        .toList(),
    enableContentTransfer: param['enableContentTransfer'] as bool?,
  );
}