UserInfo.fromJson constructor
Creates a UserInfo from JSON data.
Implementation
factory UserInfo.fromJson(Map<String, dynamic> json) {
final tempExtraJson = json['extra'];
final tempGroupsJson = json['groups'];
final tempUidJson = json['uid'];
final tempUsernameJson = json['username'];
final Map<String, List<String>>? tempExtra = tempExtraJson != null
? Map<String, dynamic>.from(tempExtraJson)
.map((key, value) => MapEntry(key, List<String>.from(value)))
: null;
final List<String>? tempGroups =
tempGroupsJson != null ? List<String>.from(tempGroupsJson) : null;
final String? tempUid = tempUidJson;
final String? tempUsername = tempUsernameJson;
return UserInfo(
extra: tempExtra,
groups: tempGroups,
uid: tempUid,
username: tempUsername,
);
}