I have a list of string from rest API like this
I try to split it using this code
e.review!.map((e) => e).join(" "),
but my expectation result is
How do I do that? Thank you
model.dart
RatingDataModel({
this.rating,
this.review,
});
int? rating;
List<String>? review;
factory RatingDataModel.fromJson(Map<String, dynamic> json) =>
RatingDataModel(
rating: json["rating"],
//separate the review by space
review: json["review"] != null
? List<String>.from(json["review"].map((x) => x))
: null,
);
Map<String, dynamic> toJson() => {
"rating": rating,
"review": List<dynamic>.from(
review!.map(
(x) => x,
),
),
};
}




split()function