Rating constructor Null safety

Rating(
  1. {int rating = 6,
  2. required dynamic onRatingSelected(
    1. int?
    ),
  3. Color? selectedColor,
  4. Color? unSelectedColor,
  5. double iconSize = 24.0,
  6. bool horizontal = true,
  7. int initialRating = 1,
  8. IconData? unSelectedIcon,
  9. IconData? selectedIcon}
)

Implementation

Rating(
    {this.rating = 6,
    required this.onRatingSelected,
    this.selectedColor,
    this.unSelectedColor,
    this.iconSize = 24.0,
    this.horizontal = true,
    this.initialRating = 1,
    this.unSelectedIcon,
    this.selectedIcon})
    : assert(onRatingSelected != null),
      assert(initialRating <= rating);