X Tutup
Skip to content

Commit a4c77cf

Browse files
committed
readme loading
1 parent aec3fa3 commit a4c77cf

File tree

4 files changed

+62
-10
lines changed

4 files changed

+62
-10
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,35 @@ flutter packages pub run build_runner build
3131

3232
### 如何主动刷新refresh,如何设置appbar上的leading和bottom,如何设置tabbar的live
3333

34-
https://github.com/flutter/flutter/issues/19030 没有webview,残念
34+
https://github.com/flutter/flutter/issues/19030 没有webview,残念
35+
36+
37+
带right icon的titlebar
38+
39+
markdown文件详情
40+
41+
图片浏览
42+
43+
搜索
44+
45+
个人动态的图片
46+
47+
commonList的过滤
48+
49+
主页drawer:关于、个人信息
50+
51+
动态页面
52+
53+
54+
仓库的:
55+
动态的背景头像
56+
版本、tag
57+
浏览器打开
58+
下载、复制克隆间接
59+
分享
60+
61+
个人页面的:
62+
关注
63+
组织
64+
头像浏览
65+

RECORD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ https://github.com/flutter/flutter/issues/19030 没有webview,残念
3131

3232
https://github.com/flutter/flutter/issues/19030#issuecomment-406656714
3333

34-
https://github.com/flutter/flutter/issues/11895#issuecomment-406832395
34+
https://github.com/flutter/flutter/issues/11895#issuecomment-406832395 tab live

lib/page/RepositoryDetailReadmePage.dart

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:gsy_github_app_flutter/common/dao/ReposDao.dart';
3-
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
43
import 'package:flutter_markdown/flutter_markdown.dart';
4+
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
55
import 'package:gsy_github_app_flutter/page/RepositoryDetailPage.dart';
66

77
/**
@@ -17,13 +17,14 @@ class RepositoryDetailReadmePage extends StatefulWidget {
1717

1818
final BranchControl branchControl;
1919

20-
RepositoryDetailReadmePage(this.userName, this.reposName, this.branchControl, { Key key }) : super(key: key);
20+
RepositoryDetailReadmePage(this.userName, this.reposName, this.branchControl, {Key key}) : super(key: key);
2121

2222
@override
2323
RepositoryDetailReadmePageState createState() => RepositoryDetailReadmePageState(userName, reposName, branchControl);
2424
}
2525

26-
class RepositoryDetailReadmePageState extends State<RepositoryDetailReadmePage> {
26+
// ignore: mixin_inherits_from_not_object
27+
class RepositoryDetailReadmePageState extends State<RepositoryDetailReadmePage> with AutomaticKeepAliveClientMixin {
2728
final String userName;
2829

2930
final String reposName;
@@ -32,7 +33,7 @@ class RepositoryDetailReadmePageState extends State<RepositoryDetailReadmePage>
3233

3334
bool isShow = false;
3435

35-
String markdownData = "";
36+
String markdownData;
3637

3738
RepositoryDetailReadmePageState(this.userName, this.reposName, this.branchControl);
3839

@@ -48,6 +49,9 @@ class RepositoryDetailReadmePageState extends State<RepositoryDetailReadmePage>
4849
});
4950
}
5051

52+
@override
53+
bool get wantKeepAlive => true;
54+
5155
@override
5256
void initState() {
5357
isShow = true;
@@ -63,10 +67,26 @@ class RepositoryDetailReadmePageState extends State<RepositoryDetailReadmePage>
6367

6468
@override
6569
Widget build(BuildContext context) {
70+
if (markdownData == null) {
71+
return Center(
72+
child: new Container(
73+
width: 140.0,
74+
height: 140.0,
75+
padding: new EdgeInsets.all(4.0),
76+
child: new Row(
77+
mainAxisAlignment: MainAxisAlignment.center,
78+
children: <Widget>[
79+
new CircularProgressIndicator(),
80+
new Container(width: 10.0),
81+
new Container(child: new Text(GSYStrings.loading_text, style: GSYConstant.middleText)),
82+
],
83+
),
84+
),
85+
);
86+
}
6687
return Container(
6788
child: SingleChildScrollView(
68-
child: new MarkdownBody(data: markdownData),
69-
)
70-
);
89+
child: new MarkdownBody(data: markdownData),
90+
));
7191
}
7292
}

lib/page/RepositoryFileListPage.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ class RepositoryDetailFileListPageState extends GSYListState<RepositoryDetailFil
4848
IconData iconData = (fileItemViewModel.type == "file") ? GSYICons.REPOS_ITEM_FILE : GSYICons.REPOS_ITEM_DIR;
4949
Widget trailing = (fileItemViewModel.type == "file") ? null : new Icon(GSYICons.REPOS_ITEM_NEXT, size: 12.0);
5050
return new GSYCardItem(
51+
margin :EdgeInsets.only(left: 10.0, top: 5.0, right: 10.0, bottom: 5.0),
5152
child: new ListTile(
5253
title: new Text(fileItemViewModel.name, style: GSYConstant.subSmallText),
53-
leading: new Icon(iconData),
54+
leading: new Icon(iconData, size: 15.0,),
5455
onTap: () {
5556
_resolveItemClick(fileItemViewModel);
5657
},

0 commit comments

Comments
 (0)
X Tutup