Skip to content

Commit

Permalink
fix: users screen title
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Sep 23, 2019
1 parent c6acbf9 commit bd4ed63
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/screens/users.dart
Expand Up @@ -10,27 +10,33 @@ class UsersScreen extends StatelessWidget {
final String scope;
final String params;
final String resource;
final String title;

UsersScreen.followers(String login)
: scope = 'user',
params = 'login: "$login"',
resource = 'followers';
resource = 'followers',
title = 'Followers';
UsersScreen.following(String login)
: scope = 'user',
params = 'login: "$login"',
resource = 'following';
resource = 'following',
title = 'Following';
UsersScreen.stars(String owner, String name)
: scope = 'repository',
params = 'owner: "$owner", name: "$name"',
resource = 'stargazers';
resource = 'stargazers',
title = 'Stargazers';
UsersScreen.watchers(String owner, String name)
: scope = 'repository',
params = 'owner: "$owner", name: "$name"',
resource = 'watchers';
resource = 'watchers',
title = 'Watchers';
UsersScreen.members(String login)
: scope = 'organization',
params = 'login: "$login"',
resource = 'membersWithRole';
resource = 'membersWithRole',
title = 'Members';

Future<ListPayload> _queryUsers(BuildContext context, [String cursor]) async {
var cursorChunk = cursor == null ? '' : ', after: "$cursor"';
Expand Down Expand Up @@ -64,7 +70,7 @@ class UsersScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListScaffold(
title: AppBarTitle('Users'),
title: AppBarTitle(title),
onRefresh: () => _queryUsers(context),
onLoadMore: (cursor) => _queryUsers(context, cursor),
itemBuilder: (payload) => UserItem(
Expand Down

0 comments on commit bd4ed63

Please sign in to comment.