diff --git a/lib/models/auth.dart b/lib/models/auth.dart index 90bead2..ccaddd0 100644 --- a/lib/models/auth.dart +++ b/lib/models/auth.dart @@ -233,7 +233,7 @@ class AuthModel with ChangeNotifier { domain: domain, token: user.username, login: username, - avatarUrl: null, + avatarUrl: user.avatarUrl, appPassword: appPassword, )); } finally { diff --git a/lib/models/bitbucket.dart b/lib/models/bitbucket.dart index b2e1189..2e436fc 100644 --- a/lib/models/bitbucket.dart +++ b/lib/models/bitbucket.dart @@ -7,6 +7,8 @@ class BbUser { String displayName; bool isStaff; DateTime createdOn; + Map links; + String get avatarUrl => links['avatar']['href']; BbUser(); factory BbUser.fromJson(Map json) => _$BbUserFromJson(json); } diff --git a/lib/models/bitbucket.g.dart b/lib/models/bitbucket.g.dart index 100185a..f91b24e 100644 --- a/lib/models/bitbucket.g.dart +++ b/lib/models/bitbucket.g.dart @@ -13,7 +13,8 @@ BbUser _$BbUserFromJson(Map json) { ..isStaff = json['is_staff'] as bool ..createdOn = json['created_on'] == null ? null - : DateTime.parse(json['created_on'] as String); + : DateTime.parse(json['created_on'] as String) + ..links = json['links'] as Map; } Map _$BbUserToJson(BbUser instance) => { @@ -21,4 +22,5 @@ Map _$BbUserToJson(BbUser instance) => { 'display_name': instance.displayName, 'is_staff': instance.isStaff, 'created_on': instance.createdOn?.toIso8601String(), + 'links': instance.links, };