Skip to content

Commit 1f15cbd

Browse files
committed
get repos header
1 parent 746974e commit 1f15cbd

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎lib/common/utils/CommonUtils.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class CommonUtils {
1515
static final double DAYS_LIMIT = 30 * HOURS_LIMIT;
1616

1717
static String getDateStr(DateTime date) {
18-
return date.toString();
18+
return date.toString().substring(0, 10);
1919
}
2020

2121
///日期格式转换

‎lib/widget/GSYTabBarWidget.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class _GSYTabBarState extends State<GSYTabBarWidget> with SingleTickerProviderSt
9797
drawer: _drawer,
9898
appBar: new AppBar(
9999
backgroundColor: _backgroundColor,
100-
title: new Text(_title),
100+
title: new Text(_title, maxLines: 1, overflow: TextOverflow.ellipsis,),
101101
),
102102
body: new TabBarView(
103103
//TabBarView呈现内容,因此放到Scaffold的body中

‎lib/widget/ReposHeaderItem.dart‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class ReposHeaderItem extends StatelessWidget {
1717
@override
1818
Widget build(BuildContext context) {
1919
String createStr = reposHeaderViewModel.repositoryIsFork
20-
? "frok at " + " " + reposHeaderViewModel.repositoryParentName + '\n'
21-
: "create at " + " " + reposHeaderViewModel.created_at + "\n";
20+
? "Frok at " + " " + reposHeaderViewModel.repositoryParentName + '\n'
21+
: "Create at " + " " + reposHeaderViewModel.created_at + "\n";
2222

23-
String updateStr = "last commit at " + reposHeaderViewModel.push_at;
23+
String updateStr = "Last commit at " + reposHeaderViewModel.push_at;
2424

2525
String infoText = createStr + ((reposHeaderViewModel.push_at != null) ? updateStr : '');
2626

@@ -47,16 +47,16 @@ class ReposHeaderItem extends StatelessWidget {
4747
new Padding(padding: new EdgeInsets.all(5.0)),
4848
new Row(
4949
children: <Widget>[
50-
new Text(reposHeaderViewModel.repositoryType, style: GSYConstant.smallTextWhite),
50+
new Text(reposHeaderViewModel.repositoryType, style: GSYConstant.subLightSmallText),
5151
new Container(width: 5.3, height: 1.0),
52-
new Text(reposHeaderViewModel.repositorySize, style: GSYConstant.smallTextWhite),
52+
new Text(reposHeaderViewModel.repositorySize, style: GSYConstant.subLightSmallText),
5353
new Container(width: 5.3, height: 1.0),
54-
new Text(reposHeaderViewModel.license, style: GSYConstant.smallTextWhite),
54+
new Text(reposHeaderViewModel.license, style: GSYConstant.subLightSmallText),
5555
],
5656
),
5757
new Padding(padding: new EdgeInsets.all(5.0)),
5858
new Container(
59-
child: new Text(reposHeaderViewModel.repositoryDes, style: GSYConstant.smallTextWhite),
59+
child: new Text(reposHeaderViewModel.repositoryDes, style: GSYConstant.subLightSmallText),
6060
margin: new EdgeInsets.only(top: 6.0, bottom: 2.0),
6161
alignment: Alignment.topLeft),
6262
new Container(
@@ -171,7 +171,7 @@ class ReposHeaderViewModel {
171171
this.repositoryIssue = map["open_issues_count"] != null ? map["open_issues_count"].toString() : "";
172172
this.repositoryIssueClose = map["closed_issues_count"] != null ? map["closed_issues_count"].toString() : "";
173173
this.repositoryIssueAll = map["all_issues_count"] != null ? map["all_issues_count"].toString() : "";
174-
this.repositorySize = ((map["size"] / 1024.0)).toString() + "M";
174+
this.repositorySize = ((map["size"] / 1024.0)).toString().substring(0, 3) + "M";
175175
this.repositoryType = map["language"];
176176
this.repositoryDes = map["description"];
177177
this.repositoryIsFork = map["fork"];

0 commit comments

Comments
 (0)