import 'dart:convert'; CoachRatingsResponseModel coachRatingsResponseModelFromJson(String str) => CoachRatingsResponseModel.fromJson(json.decode(str)); String coachRatingsResponseModelToJson(CoachRatingsResponseModel data) => json.encode(data.toJson()); class CoachRatingsResponseModel { bool? isSuccess; int? statusCode; String? message; Data? data; dynamic errors; CoachRatingsResponseModel({ this.isSuccess, this.statusCode, this.message, this.data, this.errors, }); factory CoachRatingsResponseModel.fromJson(Map json) => CoachRatingsResponseModel( isSuccess: json["isSuccess"], statusCode: json["statusCode"], message: json["message"], data: json["data"] == null ? null : Data.fromJson(json["data"]), errors: json["errors"], ); Map toJson() => { "isSuccess": isSuccess, "statusCode": statusCode, "message": message, "data": data?.toJson(), "errors": errors, }; } class Data { List? userReviewRatings; double? userAvgReviewRating; int? totalReviews; int? countOf5Star; int? countOf4Star; int? countOf3Star; int? countOf2Star; int? countOf1Star; Data({ this.userReviewRatings, this.userAvgReviewRating, this.totalReviews, this.countOf5Star, this.countOf4Star, this.countOf3Star, this.countOf2Star, this.countOf1Star, }); factory Data.fromJson(Map json) => Data( userReviewRatings: json["userReviewRatings"] == null ? [] : List.from( json["userReviewRatings"]!.map( (x) => CoachReviewRating.fromJson(x), ), ), userAvgReviewRating: json["userAvgReviewRating"]?.toDouble(), totalReviews: json["totalReviews"], countOf5Star: json["countOf5Star"], countOf4Star: json["countOf4Star"], countOf3Star: json["countOf3Star"], countOf2Star: json["countOf2Star"], countOf1Star: json["countOf1Star"], ); Map toJson() => { "userReviewRatings": userReviewRatings == null ? [] : List.from(userReviewRatings!.map((x) => x.toJson())), "userAvgReviewRating": userAvgReviewRating, "totalReviews": totalReviews, "countOf5Star": countOf5Star, "countOf4Star": countOf4Star, "countOf3Star": countOf3Star, "countOf2Star": countOf2Star, "countOf1Star": countOf1Star, }; } class CoachReviewRating { String? userId; String? firstName; String? lastName; String? fullName; String? profilePicture; int? rating; String? reviewDescription; DateTime? createdAt; CoachReviewRating({ this.userId, this.firstName, this.lastName, this.fullName, this.profilePicture, this.rating, this.reviewDescription, this.createdAt, }); factory CoachReviewRating.fromJson(Map json) => CoachReviewRating( userId: json["userID"], firstName: json["firstName"], lastName: json["lastName"], fullName: json["fullName"], profilePicture: json["profilePicture"], rating: json["rating"], reviewDescription: json["reviewDescription"], createdAt: json["createdAt"] == null ? null : DateTime.parse(json["createdAt"]), ); Map toJson() => { "userID": userId, "firstName": firstName, "lastName": lastName, "fullName": fullName, "profilePicture": profilePicture, "rating": rating, "reviewDescription": reviewDescription, "createdAt": createdAt?.toIso8601String(), }; }