store user info after login

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-06-21 23:58:13 +08:00
parent 23389ef140
commit 8dd218235d
5 changed files with 54 additions and 9 deletions

View File

@@ -14,6 +14,8 @@ class HttpType {
static const kAuthResTypeEmailCheck = "email_check";
}
// to-do: The UserPayload does not contain all the fields of the user.
// Is all the fields of the user needed?
class UserPayload {
String id = '';
String name = '';
@@ -29,6 +31,16 @@ class UserPayload {
note = json['note'] ?? '',
status = json['status'],
isAdmin = json['is_admin'] == true;
Map<String, dynamic> toJson() {
final Map<String, dynamic> map = {
'name': name,
};
if (status != null) {
map['status'] = status!;
}
return map;
}
}
class PeerPayload {