Skip to content

Commit e33ed07

Browse files
committed
update lib , update core
1 parent 3176fa5 commit e33ed07

File tree

11 files changed

+91
-101
lines changed

11 files changed

+91
-101
lines changed

ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PODS:
1818
- Flutter
1919
- path_provider (0.0.1):
2020
- Flutter
21-
- permission_handler (3.1.0):
21+
- permission_handler (3.2.2):
2222
- Flutter
2323
- Reachability (3.2)
2424
- share (0.5.2):
@@ -88,13 +88,13 @@ SPEC CHECKSUMS:
8888
android_intent: 73316069cd1f6aac919df1c6e640cad190fd5e8b
8989
connectivity: c72716e202a1225ec4810740d5cb56b8ae3bf4cc
9090
device_info: 3ebad48f726348f69abd802f3334a8d1ed795fbd
91-
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
91+
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
9292
flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694
9393
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
9494
FMDB: 6198a90e7b6900cfc046e6bc0ef6ebb7be9236aa
9595
package_info: 78cabb3c322943c55d39676f4a5bfc748c01d055
9696
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
97-
permission_handler: fa6b0d784b1a43cb96b468a5b8365cb130b1956a
97+
permission_handler: d59f41439f5bc6c4d1005f3355e98f05ddc68ece
9898
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
9999
share: 7d22fe8baedfe93aefd864bf0b73f29711fbb0a3
100100
shared_preferences: 1feebfa37bb57264736e16865e7ffae7fc99b523

lib/common/dao/issue_dao.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class IssueDao {
200200
static lockIssueDao(userName, repository, number, locked) async {
201201
String url = Address.lockIssue(userName, repository, number);
202202
var res = await httpManager.netFetch(
203-
url, null, {"Accept": 'application/vnd.github.VERSION.full+json'}, new Options(method: locked ? "DELETE" : 'PUT', contentType: ContentType.text),
203+
url, null, {"Accept": 'application/vnd.github.VERSION.full+json'}, new Options(method: locked ? "DELETE" : 'PUT', contentType: "text"),
204204
noTip: true);
205205
if (res != null && res.result) {
206206
return new DataResult(res.data, true);

lib/common/dao/repos_dao.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ class ReposDao {
177177
String urls = Address.resolveStarRepos(userName, reposName);
178178
String urlw = Address.resolveWatcherRepos(userName, reposName);
179179
var resS = await httpManager.netFetch(
180-
urls, null, null, new Options(contentType: ContentType.text),
180+
urls, null, null, new Options(contentType: "text"),
181181
noTip: true);
182182
var resW = await httpManager.netFetch(
183-
urlw, null, null, new Options(contentType: ContentType.text),
183+
urlw, null, null, new Options(contentType: "text"),
184184
noTip: true);
185185
var data = {"star": resS.result, "watch": resW.result};
186186
return new DataResult(data, true);
@@ -243,7 +243,7 @@ class ReposDao {
243243
isHtml
244244
? {"Accept": 'application/vnd.github.html'}
245245
: {"Accept": 'application/vnd.github.VERSION.raw'},
246-
new Options(contentType: text ? ContentType.text : ContentType.json),
246+
new Options(contentType: text ? "text" : "json"),
247247
);
248248
if (res != null && res.result) {
249249
if (text) {
@@ -283,7 +283,7 @@ class ReposDao {
283283
null,
284284
null,
285285
new Options(
286-
method: !star ? 'PUT' : 'DELETE', contentType: ContentType.text));
286+
method: !star ? 'PUT' : 'DELETE', contentType: "text"));
287287
return Future<DataResult>(() {
288288
return new DataResult(null, res.result);
289289
});
@@ -299,7 +299,7 @@ class ReposDao {
299299
null,
300300
null,
301301
new Options(
302-
method: !watch ? 'PUT' : 'DELETE', contentType: ContentType.text));
302+
method: !watch ? 'PUT' : 'DELETE', contentType: "text"));
303303
return new DataResult(null, res.result);
304304
}
305305

@@ -509,7 +509,7 @@ class ReposDao {
509509
static createForkDao(userName, reposName) async {
510510
String url = Address.createFork(userName, reposName);
511511
var res = await httpManager.netFetch(url, null, null,
512-
new Options(method: "POST", contentType: ContentType.text));
512+
new Options(method: "POST", contentType: "text"));
513513
return new DataResult(null, res.result);
514514
}
515515

@@ -572,7 +572,7 @@ class ReposDao {
572572
url,
573573
null,
574574
{"Accept": 'application/vnd.github.VERSION.raw'},
575-
new Options(contentType: ContentType.text));
575+
new Options(contentType: "text"));
576576
//var res = await httpManager.netFetch(url, null, {"Accept": 'application/vnd.github.html'}, new Options(contentType: ContentType.text));
577577
if (res != null && res.result) {
578578
if (needDb) {

lib/common/dao/user_dao.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class UserDao {
277277
*/
278278
static setAllNotificationAsReadDao() async {
279279
String url = Address.setAllNotificationAsRead();
280-
var res = await httpManager.netFetch(url, null, null, new Options(method: "PUT", contentType: ContentType.text));
280+
var res = await httpManager.netFetch(url, null, null, new Options(method: "PUT", contentType: "text"));
281281
return new DataResult(res.data, res.result);
282282
}
283283

@@ -286,7 +286,7 @@ class UserDao {
286286
*/
287287
static checkFollowDao(name) async {
288288
String url = Address.doFollow(name);
289-
var res = await httpManager.netFetch(url, null, null, new Options(contentType: ContentType.text), noTip: true);
289+
var res = await httpManager.netFetch(url, null, null, new Options(contentType: "text"), noTip: true);
290290
return new DataResult(res.data, res.result);
291291
}
292292

lib/common/net/interceptors/header_interceptor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ class HeaderInterceptors extends InterceptorsWrapper {
1313
///超时
1414
options.connectTimeout = 15000;
1515

16-
return options;
16+
return Future.value(options);
1717
}
1818
}

lib/common/net/interceptors/log_interceptor.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class LogsInterceptors extends InterceptorsWrapper {
1616
print('请求参数: ' + options.data.toString());
1717
}
1818
}
19-
return options;
19+
return Future.value(options);
2020
}
2121

2222
@override
@@ -26,7 +26,7 @@ class LogsInterceptors extends InterceptorsWrapper {
2626
print('返回参数: ' + response.toString());
2727
}
2828
}
29-
return response; // continue
29+
return Future.value(response); // continue
3030
}
3131

3232
@override
@@ -35,8 +35,6 @@ class LogsInterceptors extends InterceptorsWrapper {
3535
print('请求异常: ' + err.toString());
3636
print('请求异常信息: ' + err.response?.toString() ?? "");
3737
}
38-
return err;
38+
return Future.value(err); // continue;
3939
}
40-
41-
4240
}

lib/common/net/interceptors/response_interceptor.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ class ResponseInterceptors extends InterceptorsWrapper {
1212
@override
1313
onResponse(Response response) {
1414
RequestOptions option = response.request;
15+
var value;
1516
try {
16-
if (option.contentType != null && option.contentType.primaryType == "text") {
17-
return new ResultData(response.data, true, Code.SUCCESS);
17+
if (option.contentType != null && option.contentType == "text") {
18+
value = new ResultData(response.data, true, Code.SUCCESS);
1819
}
1920
if (response.statusCode == 200 || response.statusCode == 201) {
20-
return new ResultData(response.data, true, Code.SUCCESS, headers: response.headers);
21+
value = new ResultData(response.data, true, Code.SUCCESS, headers: response.headers);
2122
}
2223
} catch (e) {
2324
print(e.toString() + option.path);
24-
return new ResultData(response.data, false, response.statusCode, headers: response.headers);
25+
value = new ResultData(response.data, false, response.statusCode, headers: response.headers);
2526
}
27+
return Future.value(value);
2628
}
2729
}

lib/common/net/trending/github_trending.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'package:gsy_github_app_flutter/common/net/result_data.dart';
1313
*/
1414
class GitHubTrending {
1515
fetchTrending(url) async {
16-
var res = await httpManager.netFetch(url, null, null, new Options(contentType: ContentType.text));
16+
var res = await httpManager.netFetch(url, null, null, new Options(contentType: "text"));
1717
if (res != null && res.result && res.data != null) {
1818
return new ResultData(TrendingUtil.htmlToRepo(res.data), true, Code.SUCCESS);
1919
} else {

lib/main.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ void main() {
3131
);
3232
};
3333
runApp(FlutterReduxApp());
34-
PaintingBinding.instance.imageCache.maximumSize = 100;
35-
Provider.debugCheckInvalidValueType = null;
3634
}, onError: (Object obj, StackTrace stack) {
3735
print(obj);
3836
print(stack);

0 commit comments

Comments
 (0)