KonectarEvents/lib/contacts_module/model_class/pno_model.dart

44 lines
1.0 KiB
Dart
Raw Permalink Normal View History

2024-10-08 12:01:59 +00:00
// 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,
};
}