Skip to content

Commit 9cbb32b

Browse files
committed
Fix models
1 parent 0600389 commit 9cbb32b

6 files changed

Lines changed: 35 additions & 26 deletions

File tree

‎vrchat_dart/CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 4.0.5
2+
3+
- Makes `StreamedCurrentUser` fields `bio`, `fallbackAvatar`, and `username` optional
4+
- Replaces `StreamedCurrentUser.userIcon` and `profilePicOverride` with `iconUrl`
5+
- Adds `LimitedUser.iconUrl`
6+
17
## 4.0.4
28

39
- Allows `LimitedUser` to deserialize when `currentAvatarImageUrl` is absent

‎vrchat_dart/lib/src/model/api/limited_user.dart‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,26 @@ class LimitedUser {
3232
// Common optional fields (present in all but optional)
3333
this.bio,
3434
this.bioLinks,
35-
this.currentAvatarImageUrl,
36-
this.currentAvatarThumbnailImageUrl,
37-
this.currentAvatarTags,
38-
this.profilePicOverride,
39-
this.userIcon,
4035

4136
// Fields from specific variants
4237
this.ageVerificationStatus,
4338
this.ageVerified,
4439
this.allowAvatarCopying,
40+
this.currentAvatarImageUrl,
41+
this.currentAvatarThumbnailImageUrl,
42+
this.currentAvatarTags,
4543
this.dateJoined,
4644
this.friendKey,
45+
this.iconUrl,
4746
this.imageUrl,
4847
this.location,
4948
this.lastLogin,
5049
this.lastActivity,
5150
this.lastMobile,
5251
this.platform,
52+
this.profilePicOverride,
5353
this.profilePicOverrideThumbnail,
54+
this.userIcon,
5455
this.pronouns,
5556
this.state,
5657
});
@@ -153,6 +154,10 @@ class LimitedUser {
153154
@JsonKey(name: r'friendKey', required: false, includeIfNull: false)
154155
final String? friendKey;
155156

157+
/// The user's icon URL.
158+
@JsonKey(name: r'iconUrl', required: false, includeIfNull: false)
159+
final String? iconUrl;
160+
156161
/// The user's image URL.
157162
@JsonKey(name: r'imageUrl', required: false, includeIfNull: false)
158163
final String? imageUrl;
@@ -218,6 +223,7 @@ class LimitedUser {
218223
other.allowAvatarCopying == allowAvatarCopying &&
219224
other.dateJoined == dateJoined &&
220225
other.friendKey == friendKey &&
226+
other.iconUrl == iconUrl &&
221227
other.imageUrl == imageUrl &&
222228
other.location == location &&
223229
other.lastLogin == lastLogin &&
@@ -250,6 +256,7 @@ class LimitedUser {
250256
(allowAvatarCopying?.hashCode ?? 0) +
251257
(dateJoined?.hashCode ?? 0) +
252258
(friendKey?.hashCode ?? 0) +
259+
(iconUrl?.hashCode ?? 0) +
253260
(imageUrl?.hashCode ?? 0) +
254261
(location?.hashCode ?? 0) +
255262
(lastLogin?.hashCode ?? 0) +

‎vrchat_dart/lib/src/model/api/limited_user.g.dart‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎vrchat_dart/lib/src/model/streaming/streamed_current_user.dart‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ part 'streamed_current_user.g.dart';
99
@JsonSerializable()
1010
class StreamedCurrentUser {
1111
/// The user's bio
12-
final String bio;
12+
final String? bio;
1313

1414
/// The user's avatar id
1515
final String? currentAvatar;
@@ -24,13 +24,13 @@ class StreamedCurrentUser {
2424
final String displayName;
2525

2626
/// The user's fallbackAvatar
27-
final String fallbackAvatar;
27+
final String? fallbackAvatar;
2828

2929
/// The user's id
3030
final String id;
3131

32-
/// The user's profile pic override
33-
final String profilePicOverride;
32+
/// The user's icon URL
33+
final String? iconUrl;
3434

3535
/// The user's status
3636
final UserStatus status;
@@ -41,27 +41,23 @@ class StreamedCurrentUser {
4141
/// The user's tags
4242
final List<String> tags;
4343

44-
/// The user's icon
45-
final String userIcon;
46-
4744
/// The user's username
48-
final String username;
45+
final String? username;
4946

5047
/// Create a [StreamedCurrentUser]
5148
const StreamedCurrentUser({
52-
required this.bio,
49+
this.bio,
5350
this.currentAvatar,
5451
required this.currentAvatarImageUrl,
5552
required this.currentAvatarThumbnailImageUrl,
5653
required this.displayName,
57-
required this.fallbackAvatar,
54+
this.fallbackAvatar,
5855
required this.id,
59-
required this.profilePicOverride,
56+
this.iconUrl,
6057
required this.status,
6158
required this.statusDescription,
6259
required this.tags,
63-
required this.userIcon,
64-
required this.username,
60+
this.username,
6561
});
6662

6763
/// Create a [StreamedCurrentUser] from json

‎vrchat_dart/lib/src/model/streaming/streamed_current_user.g.dart‎

Lines changed: 5 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎vrchat_dart/pubspec.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: vrchat_dart
22
description: This is a Dart client that interacts with the unofficial VRChat API
33
homepage: https://github.com/vrchatapi/vrchatapi-dart
4-
version: 4.0.4
4+
version: 4.0.5
55

66
environment:
77
sdk: ^3.8.0

0 commit comments

Comments
 (0)