mirror of
https://github.com/git-touch/git-touch
synced 2025-03-25 15:40:09 +01:00
fix(bb): username get
This commit is contained in:
parent
7f2649c691
commit
376b8724a4
@ -50,6 +50,7 @@ class BbRepo {
|
||||
String slug;
|
||||
BbRepoMainbranch mainbranch;
|
||||
Map<String, dynamic> links;
|
||||
String get ownerLogin => fullName.split('/')[0]; // owner has no username
|
||||
String get avatarUrl => links['avatar']['href'];
|
||||
BbRepo();
|
||||
factory BbRepo.fromJson(Map<String, dynamic> json) => _$BbRepoFromJson(json);
|
||||
|
@ -38,7 +38,7 @@ class BbRepoScreen extends StatelessWidget {
|
||||
RepoHeader(
|
||||
avatarUrl: p.avatarUrl,
|
||||
avatarLink: null,
|
||||
owner: p.owner.displayName, // TODO:
|
||||
owner: p.ownerLogin,
|
||||
name: p.slug,
|
||||
description: p.description,
|
||||
homepageUrl: p.website,
|
||||
|
@ -17,11 +17,11 @@ class BbUserScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
final _login = login ?? auth.activeAccount.login;
|
||||
return RefreshStatefulScaffold<Tuple2<BbUser, Iterable<BbRepo>>>(
|
||||
title: Text(isViewer ? 'Me' : 'User'),
|
||||
fetchData: () async {
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
final _login = login ?? auth.activeAccount.login;
|
||||
final res = await Future.wait([
|
||||
auth.fetchBb('/users/$_login'),
|
||||
auth.fetchBbWithPage('/repositories/$_login'),
|
||||
@ -46,9 +46,9 @@ class BbUserScreen extends StatelessWidget {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
UserHeader(
|
||||
login: user.displayName,
|
||||
login: _login,
|
||||
avatarUrl: user.avatarUrl,
|
||||
name: user.nickname,
|
||||
name: user.displayName,
|
||||
createdAt: user.createdOn,
|
||||
bio: null,
|
||||
),
|
||||
|
@ -42,7 +42,7 @@ class RepositoryItem extends StatelessWidget {
|
||||
@required BbRepo payload,
|
||||
this.primaryLanguageName,
|
||||
this.primaryLanguageColor,
|
||||
}) : owner = payload.owner.displayName,
|
||||
}) : owner = payload.ownerLogin,
|
||||
name = payload.name,
|
||||
url = '/bitbucket/${payload.fullName}',
|
||||
avatarUrl = payload.avatarUrl,
|
||||
|
Loading…
x
Reference in New Issue
Block a user