33 lines
589 B
Dart
33 lines
589 B
Dart
|
class Message {
|
||
|
int id;
|
||
|
String fullName;
|
||
|
String email;
|
||
|
bool isChecked;
|
||
|
bool isEnabled;
|
||
|
|
||
|
Message({
|
||
|
required this.id,
|
||
|
required this.fullName,
|
||
|
required this.email,
|
||
|
this.isChecked = false,
|
||
|
this.isEnabled = true,
|
||
|
});
|
||
|
|
||
|
factory Message.fromJson(Map<String, dynamic> json) => Message(
|
||
|
id: json["id"],
|
||
|
fullName: json["name"],
|
||
|
email: json["username"],
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> toJson() => {
|
||
|
"id": id,
|
||
|
"name": fullName,
|
||
|
"username": email,
|
||
|
};
|
||
|
|
||
|
@override
|
||
|
String toString() {
|
||
|
return ' $id';
|
||
|
}
|
||
|
}
|