fix: user screen login

This commit is contained in:
Rongjian Zhang 2019-12-06 21:54:09 +08:00
parent b11d6be74b
commit f2799cacc4
2 changed files with 6 additions and 5 deletions

View File

@ -102,7 +102,9 @@ class _HomeState extends State<Home> {
// return TrendingScreen(); // return TrendingScreen();
// return RepoScreen('flutter', 'flutter'); // return RepoScreen('flutter', 'flutter');
// return Image.asset('images/spinner.webp', width: 32, height: 32); // return Image.asset('images/spinner.webp', width: 32, height: 32);
switch (Provider.of<AuthModel>(context).activeAccount.platform) { final auth = Provider.of<AuthModel>(context);
switch (auth.activeAccount.platform) {
case PlatformType.github: case PlatformType.github:
switch (index) { switch (index) {
case 0: case 0:
@ -114,7 +116,7 @@ class _HomeState extends State<Home> {
case 3: case 3:
return SearchScreen(); return SearchScreen();
case 4: case 4:
return UserScreen(null); return UserScreen(auth.activeAccount.login);
} }
break; break;
case PlatformType.gitlab: case PlatformType.gitlab:
@ -122,8 +124,7 @@ class _HomeState extends State<Home> {
case 0: case 0:
return GitlabTodosScreen(); return GitlabTodosScreen();
case 1: case 1:
return GitlabUserScreen( return GitlabUserScreen(auth.activeAccount.login);
Provider.of<AuthModel>(context).activeAccount.login);
} }
break; break;
} }

View File

@ -29,7 +29,7 @@ class UserScreen extends StatelessWidget {
Future<RepositoryOwner> _query(BuildContext context) async { Future<RepositoryOwner> _query(BuildContext context) async {
final data = await Provider.of<AuthModel>(context) final data = await Provider.of<AuthModel>(context)
.gqlClient .gqlClient
.execute(GhUserQuery(variables: GhUserArguments(login: 'pd4d10'))); .execute(GhUserQuery(variables: GhUserArguments(login: login)));
return data.data.repositoryOwner; return data.data.repositoryOwner;
} }