KonectarEvents/lib/contacts_module/model_class/patent_model.dart

40 lines
898 B
Dart
Raw Normal View History

2024-10-08 12:01:59 +00:00
// To parse this JSON data, do
//
// final patent = patentFromJson(jsonString);
import 'dart:convert';
List<Patent> patentFromJson(String str) =>
List<Patent>.from(json.decode(str).map((x) => Patent.fromJson(x)));
String patentToJson(List<Patent> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Patent {
int id;
int userId;
String patentTitle;
String status;
Patent({
required this.id,
required this.userId,
required this.patentTitle,
required this.status,
});
factory Patent.fromJson(Map<String, dynamic> json) => Patent(
id: json["id"],
userId: json["user_id"],
patentTitle: json["Patent Title"],
status: json["Status"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Patent Title": patentTitle,
"Status": status,
};
}