@@ -25,10 +25,12 @@ class CodeDetailPage extends StatefulWidget {
2525
2626 final String branch;
2727
28- CodeDetailPage ({this .title, this .userName, this .reposName, this .path, this .data, this .branch});
28+ final String htmlUrl;
29+
30+ CodeDetailPage ({this .title, this .userName, this .reposName, this .path, this .data, this .branch, this .htmlUrl});
2931
3032 @override
31- _CodeDetailPageState createState () => _CodeDetailPageState (this .title, this .userName, this .reposName, this .path, this .data, this .branch);
33+ _CodeDetailPageState createState () => _CodeDetailPageState (this .title, this .userName, this .reposName, this .path, this .data, this .branch, this .htmlUrl );
3234}
3335
3436class _CodeDetailPageState extends State <CodeDetailPage > {
@@ -40,15 +42,18 @@ class _CodeDetailPageState extends State<CodeDetailPage> {
4042
4143 final String branch;
4244
45+ final String htmlUrl;
46+
4347 String data;
4448
4549 final String title;
4650
47- _CodeDetailPageState (this .title, this .userName, this .reposName, this .path, this .data, this .branch);
51+ _CodeDetailPageState (this .title, this .userName, this .reposName, this .path, this .data, this .branch, this .htmlUrl );
4852
4953 @override
5054 void initState () {
5155 super .initState ();
56+ print (data);
5257 if (data == null ) {
5358 ReposDao .getReposFileDirDao (userName, reposName, path: path, branch: branch, text: true ).then ((res) {
5459 if (res != null && res.result) {
@@ -63,7 +68,10 @@ class _CodeDetailPageState extends State<CodeDetailPage> {
6368 @override
6469 Widget build (BuildContext context) {
6570 String currentBranch = ((branch == null ) ? "" : ("/" + branch));
66- String url = Address .hostWeb + userName + "/" + reposName + "/blob" + currentBranch + path;
71+ String url = htmlUrl;
72+ if (data == null ) {
73+ url = Address .hostWeb + userName + "/" + reposName + "/blob" + currentBranch + path;
74+ }
6775 Widget widget = (data == null )
6876 ? new Center (
6977 child: new Container (
0 commit comments