// To parse this JSON data, do // // final phoneno = phonenoFromJson(jsonString); import 'dart:convert'; List phonenoFromJson(String str) => List.from(json.decode(str).map((x) => Phoneno.fromJson(x))); String phonenoToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); class Phoneno { int id; int userId; String phoneType; String locations; String phoneNumber; Phoneno({ required this.id, required this.userId, required this.phoneType, required this.locations, required this.phoneNumber, }); factory Phoneno.fromJson(Map json) => Phoneno( id: json["id"], userId: json["user_id"], phoneType: json["Phone type"], locations: json["Locations"], phoneNumber: json["phone Number"], ); Map toJson() => { "id": id, "user_id": userId, "Phone type": phoneType, "Locations": locations, "phone Number": phoneNumber, }; }