Post constructor Null safety

const Post(
  1. {required String id,
  2. required String title,
  3. required String? text,
  4. required int upVotes,
  5. required int downVotes,
  6. required double upVotesRatio,
  7. required Subreddit subReddit,
  8. String? videoUrl,
  9. String? imageUrl}
)

Create a new Post.

Implementation

const Post({
  required this.id,
  required this.title,
  required this.text,
  required this.upVotes,
  required this.downVotes,
  required this.upVotesRatio,
  required this.subReddit,
  this.videoUrl,
  this.imageUrl
});