toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final data = <String, Object?>{};
  data['presence'] = presence.toString().split('.').last;
  if (lastActiveAgo != null) {
    data['last_active_ago'] = lastActiveAgo;
  }
  if (statusMsg != null) {
    data['status_msg'] = statusMsg;
  }
  if (currentlyActive != null) {
    data['currently_active'] = currentlyActive;
  }
  return data;
}