1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-16 18:28:51 +01:00

fix: current branch name

This commit is contained in:
Rongjian Zhang 2019-09-23 19:51:49 +08:00
parent b07b25fca0
commit 89786c307e

View File

@ -37,7 +37,6 @@ class RepositoryScreen extends StatelessWidget {
get _branchQueryChunk =>
branch == null ? 'defaultBranchRef' : 'ref(qualifiedName: "$branch")';
get _branchName => branch ?? 'master';
get branchInfoKey => branch == null ? 'defaultBranchRef' : 'ref';
Future queryRepo(BuildContext context) async {
@ -284,7 +283,7 @@ class RepositoryScreen extends StatelessWidget {
TableView(
hasIcon: true,
items: [
if (payload[branchInfoKey] != null)
if (payload[branchInfoKey] != null) ...[
TableViewItem(
leftIconData: Octicons.history,
text: Text('Commits'),
@ -297,10 +296,11 @@ class RepositoryScreen extends StatelessWidget {
TableViewItem(
leftIconData: Octicons.git_branch,
text: Text('Branches'),
rightWidget: Text(_branchName +
rightWidget: Text(payload[branchInfoKey]['name'] +
'' +
numberFormat.format(payload['refs']['totalCount'])),
onTap: () async {
// FIXME: Show all branches
var result = await Provider.of<ThemeModel>(context)
.showDialogOptions(
context,
@ -313,11 +313,12 @@ class RepositoryScreen extends StatelessWidget {
if (result != null) {
Provider.of<ThemeModel>(context).pushReplacementRoute(
context,
(_) =>
RepositoryScreen(owner, name, branch: result));
(_) => RepositoryScreen(owner, name,
branch: result));
}
},
),
],
TableViewItem(
leftIconData: Octicons.law,
text: Text('License'),