I'm getting this error while showing rating from firebase to ratingbarindicator. Please help Here is my ratingbarindicator code:
RatingBarIndicator(
rating: widget.doctor.rating,
itemBuilder: (context, index) => Icon(
Icons.star,
color: Colors.amber,
),
itemCount: 5,
itemSize: 15.0,
direction: Axis.horizontal),
According to the code inside the class
RatingBarIndicator, thetruncate()method is being called on theratingproperty:Therefore the value of
widget.doctor.ratingis null and that's why you get this error.