mobileapplicationPassvault/lib/modelclasses/edit_credential_model.dart

86 lines
2.0 KiB
Dart
Raw Permalink Normal View History

2024-04-12 05:23:32 +00:00
import 'dart:convert';
MyEditCredentialDta myEditCredentialDtaFromJson(String str) =>
MyEditCredentialDta.fromJson(json.decode(str));
String myEditCredentialDtaToJson(MyEditCredentialDta data) =>
json.encode(data.toJson());
class MyEditCredentialDta {
bool success;
String message;
Data data;
MyEditCredentialDta({
required this.success,
required this.message,
required this.data,
});
factory MyEditCredentialDta.fromJson(Map<String, dynamic> json) =>
MyEditCredentialDta(
success: json["success"],
message: json["message"],
data: Data.fromJson(json["data"]),
);
Map<String, dynamic> toJson() => {
"success": success,
"message": message,
"data": data.toJson(),
};
@override
String toString() {
return message;
}
}
class Data {
int id;
String name;
String username;
String password;
String detail;
int createdBy;
int modifiedBy;
DateTime createdAt;
DateTime updatedAt;
Data({
required this.id,
required this.name,
required this.username,
required this.password,
required this.detail,
required this.createdBy,
required this.modifiedBy,
required this.createdAt,
required this.updatedAt,
});
factory Data.fromJson(Map<String, dynamic> json) => Data(
id: json["id"],
name: json["name"],
username: json["username"],
password: json["password"],
detail: json["detail"],
createdBy: json["created_by"],
modifiedBy: json["modified_by"],
createdAt: DateTime.parse(json["created_at"]),
updatedAt: DateTime.parse(json["updated_at"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"name": name,
"username": username,
"password": password,
"detail": detail,
"created_by": createdBy,
"modified_by": modifiedBy,
"created_at": createdAt.toIso8601String(),
"updated_at": updatedAt.toIso8601String(),
};
}