RatingModel.fromJson constructor

RatingModel.fromJson(
  1. Map<String, dynamic> json
)

Creates a RatingModel instance from a JSON object.

The json parameter is a map representing the JSON object.

Returns a RatingModel instance.

Implementation

factory RatingModel.fromJson(Map<String, dynamic> json) {
  return RatingModel(
    rate: (json['rate'] ?? 0) as num,
    count: (json['count'] ?? 0) as num,
  );
}