|
| 1 | +import 'dart:io'; |
| 2 | + |
1 | 3 | import 'package:flutter/material.dart'; |
2 | 4 | import 'package:gsy_github_app_flutter/common/dao/ReposDao.dart'; |
3 | 5 | import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart'; |
@@ -122,14 +124,25 @@ class RepositoryDetailFileListPageState extends GSYListState<RepositoryDetailFil |
122 | 124 | if (CommonUtils.isImageEnd(fileItemViewModel.name)) { |
123 | 125 | //todo 图片 |
124 | 126 | } else { |
125 | | - CommonUtils.showLoadingDialog(context); |
126 | | - ReposDao.getReposFileDirDao(userName, reposName, path: path, branch: branchControl.currentBranch, text: true).then((res) { |
127 | | - if (res != null && res.result) { |
128 | | - Navigator.pop(context); |
129 | | - String data = HtmlUtils.resolveHtmlFile(res, "java"); |
130 | | - CommonUtils.launchWebView(context, fileItemViewModel.name, data); |
131 | | - } |
132 | | - }); |
| 127 | + if (Platform.isIOS) { |
| 128 | + NavigatorUtils.gotoCodeDetailPage( |
| 129 | + context, |
| 130 | + title: fileItemViewModel.name, |
| 131 | + reposName: reposName, |
| 132 | + userName: userName, |
| 133 | + path: path, |
| 134 | + branch: branchControl.currentBranch, |
| 135 | + ); |
| 136 | + } else { |
| 137 | + CommonUtils.showLoadingDialog(context); |
| 138 | + ReposDao.getReposFileDirDao(userName, reposName, path: path, branch: branchControl.currentBranch, text: true, isHtml: true).then((res) { |
| 139 | + if (res != null && res.result) { |
| 140 | + Navigator.pop(context); |
| 141 | + String data = HtmlUtils.resolveHtmlFile(res, "java"); |
| 142 | + CommonUtils.launchWebView(context, fileItemViewModel.name, data); |
| 143 | + } |
| 144 | + }); |
| 145 | + } |
133 | 146 | } |
134 | 147 | } |
135 | 148 | } |
|
0 commit comments