toMap method

Map<String, dynamic> toMap()

转换为Map

Implementation

Map<String, dynamic> toMap() {
  return {
    'type': type.name,
    if (videoId != null) 'videoId': videoId,
    if (data != null) 'data': data,
    if (error != null) 'error': error,
    if (errorCode != null) 'code': errorCode,
    if (isLike != null) 'isLike': isLike,
    if (isSucceed != null) 'isSucceed': isSucceed,
    if (title != null) 'title': title,
    if (userName != null) 'userName': userName,
    if (commentCount != null) 'commentCount': commentCount,
    if (publishTime != null) 'publishTime': publishTime,
  };
}