import 'dart:convert'; ShareCredentialData shareCredentialDataFromJson(String str) => ShareCredentialData.fromJson(json.decode(str)); String shareCredentialDataToJson(ShareCredentialData data) => json.encode(data.toJson()); class ShareCredentialData { bool success; String message; Data data; ShareCredentialData({ required this.success, required this.message, required this.data, }); factory ShareCredentialData.fromJson(Map json) => ShareCredentialData( success: json["success"], message: json["message"], data: Data.fromJson(json["data"]), ); Map 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 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 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(), }; }