Skip to content

Commit 663aa70

Browse files
author
yangshangzhi
committed
Merge branch 'test'
2 parents ed27b0a + 9d491b9 commit 663aa70

File tree

20 files changed

+86
-331
lines changed

20 files changed

+86
-331
lines changed

docs/widget/scrollview/gridview/bd.md

Lines changed: 0 additions & 208 deletions
This file was deleted.

docs/widget/scrollview/listview/code.md

Whitespace-only changes.

docs/widget/scrollview/listview/index.md

Whitespace-only changes.

lib/components/widgetComp.dart

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ import 'package:efox_flutter/router/index.dart' show FluroRouter;
1212
class 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)}',
@@ -166,34 +149,23 @@ class IndexState extends State<Index> {
166149
child: Row(children: [
167150
Icon(
168151
Icons.home,
169-
color: Color(model.theme.blackColor),
152+
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.blackColor),
181-
),
182-
Text(" "),
183-
Text("Markdown"),
184-
]),
185-
value: 1,
186-
),
187159
PopupMenuItem(
188160
child: Row(children: [
189161
Icon(
190162
Icons.code,
191-
color: Color(model.theme.blackColor),
163+
color: Color(model.theme.greyColor),
192164
),
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(

lib/config/index.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'development.dart' as Development;
22
import 'production.dart' as Production;
33

4-
const bool isPro = false;
4+
const bool isPro = true;
55

66
Object env = isPro ? Production.Config() : Development.Config();

lib/store/http.dart

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
import 'package:dio/dio.dart';
22

3-
request() async {
3+
Future<dynamic> get(url, [data = const {}]) async {
44
Dio dio = new Dio(); // with default Options
5+
// dio.interceptors
6+
// .add(InterceptorsWrapper(onRequest: (RequestOptions requestOptions) {
7+
// return dio.resolve('sfs');
8+
// }));
9+
dio.interceptors.add(LogInterceptor(responseBody: true));
10+
try {
11+
return await dio.get(url).then((res) => res.data);
12+
} on DioError catch(e) {
13+
return e.response;
14+
}
15+
}
516

17+
Future post(url, [data = const {}, params = const {}]) async {
18+
Dio dio = new Dio(); // with default Options
19+
// dio.interceptors
20+
// .add(InterceptorsWrapper(onRequest: (RequestOptions requestOptions) {
21+
// return dio.resolve('sfs');
22+
// }));
23+
return dio.post(url, data: data, queryParameters: params);
624
}

0 commit comments

Comments
 (0)