toJson method
Converts a UserInfo instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempExtra = extra;
final tempGroups = groups;
final tempUid = uid;
final tempUsername = username;
if (tempExtra != null) {
jsonData['extra'] = tempExtra;
}
if (tempGroups != null) {
jsonData['groups'] = tempGroups;
}
if (tempUid != null) {
jsonData['uid'] = tempUid;
}
if (tempUsername != null) {
jsonData['username'] = tempUsername;
}
return jsonData;
}