2019-11-30 09:36:30 +00:00
|
|
|
/// Represents a user profile returned by a /profile request.
|
|
|
|
class Profile {
|
|
|
|
/// The user's avatar URL if they have set one, otherwise null.
|
2020-04-24 07:24:06 +00:00
|
|
|
final Uri avatarUrl;
|
2019-11-30 09:36:30 +00:00
|
|
|
|
|
|
|
/// The user's display name if they have set one, otherwise null.
|
|
|
|
final String displayname;
|
|
|
|
|
|
|
|
/// This API may return keys which are not limited to displayname or avatar_url.
|
|
|
|
final Map<String, dynamic> content;
|
|
|
|
|
|
|
|
Profile.fromJson(Map<String, dynamic> json)
|
2020-04-24 07:24:06 +00:00
|
|
|
: avatarUrl = Uri.parse(json['avatar_url']),
|
2019-11-30 09:36:30 +00:00
|
|
|
displayname = json['displayname'],
|
|
|
|
content = json;
|
2020-01-18 14:49:15 +00:00
|
|
|
|
2020-03-30 09:08:38 +00:00
|
|
|
@override
|
2020-01-18 14:49:15 +00:00
|
|
|
bool operator ==(dynamic other) =>
|
2020-04-24 07:24:06 +00:00
|
|
|
avatarUrl == other.avatarUrl && displayname == other.displayname;
|
2019-11-30 09:36:30 +00:00
|
|
|
}
|