86 lines
2.0 KiB
Dart
86 lines
2.0 KiB
Dart
|
import 'dart:convert';
|
||
|
|
||
|
MDeleteCredentialData mDeleteCredentialDataFromJson(String str) =>
|
||
|
MDeleteCredentialData.fromJson(json.decode(str));
|
||
|
|
||
|
String mDeleteCredentialDataToJson(MDeleteCredentialData data) =>
|
||
|
json.encode(data.toJson());
|
||
|
|
||
|
class MDeleteCredentialData {
|
||
|
bool success;
|
||
|
String message;
|
||
|
Data data;
|
||
|
|
||
|
MDeleteCredentialData({
|
||
|
required this.success,
|
||
|
required this.message,
|
||
|
required this.data,
|
||
|
});
|
||
|
|
||
|
factory MDeleteCredentialData.fromJson(Map<String, dynamic> json) =>
|
||
|
MDeleteCredentialData(
|
||
|
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(),
|
||
|
};
|
||
|
}
|