import 'package:muaawana/models/order/Technician.dart'; import '../ads/Images.dart'; import '../booking_service/Address.dart'; class UrgentRequest { UrgentRequest({ this.id, this.date, this.comment, this.requeststate, this.technician, this.driverState, this.address, this.images, this.timestamp, this.userPhone, }); UrgentRequest.fromJson(dynamic json) { id = json['id']; date = json['date']; comment = json['comment']; requeststate = json['requeststate']; technician = json['technician'] != null ? Technician.fromJson(json['technician']) : null; // technician = json['technician']; driverState = json['driverState']; address = json['address'] != null ? Address.fromJson(json['address']) : null; if (json['images'] != null) { images = []; json['images'].forEach((v) { images?.add(Images.fromJson(v)); }); } timestamp = json['timestamp']; userPhone = json['userPhone']; } int? id; int? date; String? comment; String? requeststate; Technician? technician; String? driverState; Address? address; List? images; int? timestamp; String? userPhone; Map toJson() { final map = {}; map['id'] = id; map['date'] = date; map['comment'] = comment; map['requeststate'] = requeststate; if (technician != null) { map['technician'] = technician?.toJson(); } map['driverState'] = driverState; if (address != null) { map['address'] = address?.toJson(); } if (images != null) { map['images'] = images?.map((v) => v.toJson()).toList(); } map['timestamp'] = timestamp; return map; } }