// To parse this JSON data, do // // final email = emailFromJson(jsonString); import 'dart:convert'; List emailFromJson(String str) => List.from(json.decode(str).map((x) => Email.fromJson(x))); String emailToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); class Email { int id; int userId; String emailType; String email; Email({ required this.id, required this.userId, required this.emailType, required this.email, }); factory Email.fromJson(Map json) => Email( id: json["id"], userId: json["user_id"], emailType: json["Email Type"], email: json["Email"], ); Map toJson() => { "id": id, "user_id": userId, "Email Type": emailType, "Email": email, }; }