I am using where clause to filter out what user is typing with the api result but I am getting Error: Unexpected null value.
I am using a post request.
this is my model :-
class SearchSquad {
SearchSquad({
required this.count,
required this.res,
});
int count;
List<Re> res;
factory SearchSquad.fromJson(Map<String, dynamic> json) => SearchSquad(
count: json["count"],
res: List<Re>.from(json["res"].map((x) => Re.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"count": count,
"res": List<dynamic>.from(res.map((x) => x.toJson())),
};
}
class Re {
Re({
required this.squadName,
required this.profimgname,
required this.profimgurl,
});
String squadId;
String squadName;