@@ -12,15 +12,13 @@ import 'package:efox_flutter/router/index.dart' show FluroRouter;
1212class Index extends StatefulWidget {
1313 final List <Widget > demoChild;
1414 final String originCodeUrl;
15- final String codeUrl;
1615 final String mdUrl;
1716 final String title;
1817 Index ({
1918 Key key,
2019 this .title,
2120 this .demoChild,
2221 this .originCodeUrl,
23- this .codeUrl,
2422 this .mdUrl,
2523 }) : super (key: key);
2624
@@ -29,7 +27,6 @@ class Index extends StatefulWidget {
2927 title: title,
3028 demoChild: demoChild,
3129 originCodeUrl: originCodeUrl,
32- codeUrl: codeUrl,
3330 mdUrl: mdUrl);
3431}
3532
@@ -39,7 +36,6 @@ class IndexState extends State<Index> {
3936 final List mdList;
4037 final List <Widget > demoChild;
4138 final String originCodeUrl;
42- final String codeUrl;
4339 final String mdUrl;
4440 final String title;
4541 bool loading = true ;
@@ -52,7 +48,6 @@ class IndexState extends State<Index> {
5248 this .mdList,
5349 this .demoChild,
5450 this .originCodeUrl,
55- this .codeUrl,
5651 this .mdUrl,
5752 });
5853
@@ -98,7 +93,7 @@ class IndexState extends State<Index> {
9893 // 加载页面
9994 if (model.config.state.isPro) {
10095 FluroRouter .router.navigateTo (context,
101- '/webview?url=${Uri .encodeComponent (model .config .state .env .GithubAssetOrigin + url )}' );
96+ '/webview?url=${Uri .encodeComponent (model .config .state .env .GithubAssetOrigin + url . replaceAll ( RegExp ( '/index.md' ), '' ) )}' );
10297 } else {
10398 // 加载本地
10499 String mdStr = await FileUtils .readLocaleFile (url);
@@ -116,27 +111,18 @@ class IndexState extends State<Index> {
116111 }
117112
118113 Future getMdFile (url) async {
119- String mdStr = await LoadAssetUtils .loadMarkdownAssets (url);
114+ String mdStr = ( await LoadAssetUtils .loadMarkdownAssets (url)). toString ( );
120115 return mdStr;
121116 }
122117
123118 getActions (context, model) {
124119 return [
125- IconButton (
126- icon: Icon (
127- Icons .favorite_border,
128- ),
129- onPressed: () async {
130- // TODO favirote
131- this .openPage (context, model, this .mdUrl);
132- },
133- ),
134120 IconButton (
135121 icon: Icon (
136122 Icons .code,
137123 ),
138124 onPressed: () async {
139- this .openPage (context, model, this .codeUrl );
125+ this .openPage (context, model, this .mdUrl );
140126 },
141127 ),
142128 PopupMenuButton (
@@ -150,9 +136,6 @@ class IndexState extends State<Index> {
150136 );
151137 break ;
152138 case 1 :
153- this .openPage (context, model, this .mdUrl);
154- break ;
155- case 2 :
156139 FluroRouter .router.navigateTo (
157140 context,
158141 '/webview?url=${Uri .encodeComponent (this .originCodeUrl )}' ,
@@ -169,21 +152,10 @@ class IndexState extends State<Index> {
169152 color: Color (model.theme.greyColor),
170153 ),
171154 Text (" " ),
172- Text ('官网 ' ),
155+ Text ('Flutter-UI ' ),
173156 ]),
174157 value: 0 ,
175158 ),
176- PopupMenuItem (
177- child: Row (children: [
178- Icon (
179- Icons .all_inclusive,
180- color: Color (model.theme.greyColor),
181- ),
182- Text (" " ),
183- Text ("Markdown" ),
184- ]),
185- value: 1 ,
186- ),
187159 PopupMenuItem (
188160 child: Row (children: [
189161 Icon (
@@ -193,7 +165,7 @@ class IndexState extends State<Index> {
193165 Text (" " ),
194166 Text (this .title),
195167 ]),
196- value: 2 ,
168+ value: 1 ,
197169 ),
198170 ];
199171 },
@@ -226,7 +198,6 @@ class IndexState extends State<Index> {
226198 mainAxisSize: MainAxisSize .min,
227199 children: < Widget > [
228200 CircularProgressIndicator (
229- // backgroundColor: Color(this.model.theme.mainColor),
230201 strokeWidth: 4 ,
231202 ),
232203 Container (
0 commit comments