44 lines
1.0 KiB
Dart
44 lines
1.0 KiB
Dart
// To parse this JSON data, do
|
|
//
|
|
// final phoneno = phonenoFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
|
|
List<Phoneno> phonenoFromJson(String str) =>
|
|
List<Phoneno>.from(json.decode(str).map((x) => Phoneno.fromJson(x)));
|
|
|
|
String phonenoToJson(List<Phoneno> data) =>
|
|
json.encode(List<dynamic>.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<String, dynamic> json) => Phoneno(
|
|
id: json["id"],
|
|
userId: json["user_id"],
|
|
phoneType: json["Phone type"],
|
|
locations: json["Locations"],
|
|
phoneNumber: json["phone Number"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"id": id,
|
|
"user_id": userId,
|
|
"Phone type": phoneType,
|
|
"Locations": locations,
|
|
"phone Number": phoneNumber,
|
|
};
|
|
}
|