import '../ads/Images.dart'; class Service { Service({ this.id, this.description, this.price, this.name, this.images, this.timestmp, this.ratingAverage, this.arName, this.userBookmarked, }); Service.fromJson(dynamic json) { id = json['id']; description = json['description']; price = json['price']; name = json['name']; if (json['images'] != null) { images = []; json['images'].forEach((v) { images?.add(Images.fromJson(v)); }); } timestmp = json['timestmp']; ratingAverage = json['ratingAverage']; arName = json['nomAr']; userBookmarked = json['userBookmarked']; } int? id; String? description; double? price; String? name; List? images; int? timestmp; double? ratingAverage; String? arName; bool? userBookmarked; Map toJson() { final map = {}; map['id'] = id; map['description'] = description; map['price'] = price; map['name'] = name; if (images != null) { map['images'] = images?.map((v) => v.toJson()).toList(); } map['timestmp'] = timestmp; map['ratingRating'] = ratingAverage; map['userBookmarked'] = userBookmarked; return map; } }