11import 'package:flutter/material.dart' ;
2- import 'package:efox_flutter/store/store .dart' show Store;
2+ import 'package:efox_flutter/store/index .dart' show Store;
33import 'header.dart' as Header;
44import 'package:efox_flutter/components/markdownComp.dart' as MarkDownComp;
55import 'package:efox_flutter/lang/app_translations.dart' show AppTranslations;
@@ -88,20 +88,19 @@ class IndexState extends State<Index> {
8888 ),
8989 actions: this .getActions (
9090 context,
91- model,
9291 ),
9392 ),
9493 body: this .loading ? this .renderLoading () : this .renderWidget (),
9594 );
9695 });
9796 }
9897
99- openPage (context, model ) async {
98+ openPage (context) async {
10099 String url = this .mdUrl;
101100 // 加载页面
102- if (model.config.state.isPro) {
101+ if (this . model.config.state.isPro) {
103102 FluroRouter .router.navigateTo (context,
104- '/webview?url=${Uri .encodeComponent (model .config .state .env .GithubAssetOrigin + url .replaceAll (RegExp ('/index.md' ), '' ))}' );
103+ '/webview?url=${Uri .encodeComponent (this . model .config .state .env .GithubAssetOrigin + url .replaceAll (RegExp ('/index.md' ), '' ))}' );
105104 } else {
106105 // 加载本地
107106 String mdStr = await FileUtils .readLocaleFile (url);
@@ -123,7 +122,7 @@ class IndexState extends State<Index> {
123122 return mdStr;
124123 }
125124
126- getActions (context, model ) {
125+ getActions (context) {
127126 return [
128127 IconButton (
129128 icon: Icon (
@@ -141,62 +140,17 @@ class IndexState extends State<Index> {
141140 Icons .code,
142141 ),
143142 onPressed: () async {
144- this .openPage (context, model );
143+ this .openPage (context);
145144 },
146145 ),
147146 IconButton (
148147 icon: Icon (Icons .share),
149148 onPressed: () {
150149 final String msg =
151- model.config.state.env.GithubAssetOrigin + this .mdUrl;
150+ this . model.config.state.env.GithubAssetOrigin + this .mdUrl;
152151 AppShare .shareText (msg);
153152 },
154153 ),
155- // PopupMenuButton(
156- // offset: Offset(0, 80),
157- // onSelected: (index) {
158- // switch (index) {
159- // case 0:
160- // FluroRouter.router.navigateTo(
161- // context,
162- // '/webview?url=${Uri.encodeComponent('https://github.com/efoxTeam/flutter-ui')}',
163- // );
164- // break;
165- // case 1:
166- // FluroRouter.router.navigateTo(
167- // context,
168- // '/webview?url=${Uri.encodeComponent(this.originCodeUrl)}',
169- // );
170- // break;
171- // }
172- // },
173- // itemBuilder: (context) {
174- // return [
175- // PopupMenuItem(
176- // child: Row(children: [
177- // Icon(
178- // Icons.home,
179- // color: Color(AppTheme.greyColor),
180- // ),
181- // Text(" "),
182- // Text('Flutter-UI'),
183- // ]),
184- // value: 0,
185- // ),
186- // PopupMenuItem(
187- // child: Row(children: [
188- // Icon(
189- // Icons.code,
190- // color: Color(AppTheme.greyColor),
191- // ),
192- // Text(" "),
193- // Text(this.title),
194- // ]),
195- // value: 1,
196- // ),
197- // ];
198- // },
199- // ),
200154 ];
201155 }
202156
0 commit comments