import 'package:json_annotation/json_annotation.dart'; @JsonSerializable() class albumResponse { String id; String image; String name; String description; String voice_note; albumResponse({this.id, this.image, this.name, this.description, this.voice_note}); Map toJson() => {'id': id, 'image': image,'name':name,'description':description,'voice_note':voice_note}; factory albumResponse.fromJson(Map json) { return albumResponse( id: json['id'], image: json['image'], name: json['name'], description: json['description'], voice_note: json['voice_note'] ); } }