@@ -34,9 +34,8 @@ class ReleasePage extends StatefulWidget {
3434 _ReleasePageState createState () => _ReleasePageState ();
3535}
3636
37-
38- class _ReleasePageState extends State <ReleasePage > with AutomaticKeepAliveClientMixin <ReleasePage >, GSYListState <ReleasePage > {
39-
37+ class _ReleasePageState extends State <ReleasePage >
38+ with AutomaticKeepAliveClientMixin <ReleasePage >, GSYListState <ReleasePage > {
4039 ///配置标题了右侧的更多显示
4140 final OptionControl titleOptionControl = new OptionControl ();
4241
@@ -45,23 +44,21 @@ class _ReleasePageState extends State<ReleasePage> with AutomaticKeepAliveClient
4544
4645 ///绘制item
4746 _renderEventItem (index) {
48- ReleaseItemViewModel releaseItemViewModel = ReleaseItemViewModel .fromMap (pullLoadWidgetControl.dataList[index]);
47+ ReleaseItemViewModel releaseItemViewModel =
48+ ReleaseItemViewModel .fromMap (pullLoadWidgetControl.dataList[index]);
4949 return new ReleaseItem (
5050 releaseItemViewModel,
5151 onPressed: () {
52- if (selectIndex == 0 ) {
53- if (Platform .isIOS) {
54- NavigatorUtils .gotoCodeDetailPage (
55- context,
56- title: releaseItemViewModel.actionTitle,
57- userName: widget.userName,
58- reposName: widget.reposName,
59- data: HtmlUtils .generateHtml (releaseItemViewModel.actionTargetHtml, backgroundColor: GSYColors .webDraculaBackgroundColorString),
60- );
61- } else {
62- String html = HtmlUtils .generateHtml (releaseItemViewModel.actionTargetHtml, backgroundColor: GSYColors .miWhiteString, userBR: false );
63- CommonUtils .launchWebView (context, releaseItemViewModel.actionTitle, html);
64- }
52+ ///没有 release 提示就不要了
53+ if (selectIndex == 0 &&
54+ releaseItemViewModel.actionTargetHtml != null &&
55+ releaseItemViewModel.actionTargetHtml.length > 0 ) {
56+ String html = HtmlUtils .generateHtml (
57+ releaseItemViewModel.actionTargetHtml,
58+ backgroundColor: GSYColors .miWhiteString,
59+ userBR: false );
60+ CommonUtils .launchWebView (
61+ context, releaseItemViewModel.actionTitle, html);
6562 }
6663 },
6764 onLongPress: () {
@@ -76,7 +73,10 @@ class _ReleasePageState extends State<ReleasePage> with AutomaticKeepAliveClient
7673 if (await canLaunch (url)) {
7774 await launch (url);
7875 } else {
79- Fluttertoast .showToast (msg: CommonUtils .getLocale (context).option_web_launcher_error + ": " + url);
76+ Fluttertoast .showToast (
77+ msg: CommonUtils .getLocale (context).option_web_launcher_error +
78+ ": " +
79+ url);
8080 }
8181 }
8282
@@ -90,7 +90,9 @@ class _ReleasePageState extends State<ReleasePage> with AutomaticKeepAliveClient
9090 }
9191
9292 _getDataLogic () async {
93- return await ReposDao .getRepositoryReleaseDao (widget.userName, widget.reposName, page, needHtml: Platform .isAndroid, release: selectIndex == 0 );
93+ return await ReposDao .getRepositoryReleaseDao (
94+ widget.userName, widget.reposName, page,
95+ needHtml: true , release: selectIndex == 0 );
9496 }
9597
9698 @override
0 commit comments