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