toMap method Null safety

Map<String, dynamic> toMap()

Creates a Map<String, dynamic> from a Post object

Implementation

Map<String, dynamic> toMap() {
  return {
    'body': body,
    'title': title,
    'subReddit': body,
    'username': username,
    'media_url': mediaUrl,
    'typeMediaUrl': typeMediaUrl,
    'upVotes': upVotes,
    'downVotes': downVotes,
    'myUpVotes': myUpVotes,
    'myDownVotes': myDownVotes,
    'createdUtc': createdUtc
  };
}