class PackageModel { final int id; final String name; final String price; final int duration; final String description; final int type; final int noOfService; final String createdDate; PackageModel({ required this.id, required this.name, required this.price, required this.duration, required this.description, required this.type, required this.noOfService, required this.createdDate, }); factory PackageModel.fromJson(Map json) { return PackageModel( id: json['id'], name: json['name'], price: json['price'], duration: json['duration'], description: json['description'], type: json['type'], noOfService: json['no_of_service'], createdDate: json['created_date'], ); } Map toJson() { return { 'id': id, 'name': name, 'price': price, 'duration': duration, 'description': description, 'type': type, 'no_of_service': noOfService, 'created_date': createdDate, }; } }