diff --git a/lib/src/weibo.dart b/lib/src/weibo.dart index 6315723..19ee5b2 100644 --- a/lib/src/weibo.dart +++ b/lib/src/weibo.dart @@ -37,13 +37,13 @@ class Weibo { 'https://api.weibo.com/oauth2/default.html'; final MethodChannel _channel = - const MethodChannel('v7lin.github.io/fake_weibo'); + const MethodChannel('v7lin.github.io/fake_weibo'); final StreamController _authRespStreamController = - StreamController.broadcast(); + StreamController.broadcast(); final StreamController _shareMsgRespStreamController = - StreamController.broadcast(); + StreamController.broadcast(); Future registerApp({ @required String appKey, @@ -122,7 +122,7 @@ class Weibo { }; return HttpClient() .getUrl(_encodeUrl('https://api.weibo.com/2/users/show.json', appkey, - accessToken, params)) + accessToken, params)) .then((HttpClientRequest request) { return request.close(); }).then((HttpClientResponse response) async { @@ -132,20 +132,21 @@ class Weibo { .fromMap(json.decode(content) as Map); } throw HttpException( - 'HttpResponse statusCode: ${response - .statusCode}, reasonPhrase: ${response.reasonPhrase}.'); + 'HttpResponse statusCode: ${response.statusCode}, reasonPhrase: ${response.reasonPhrase}.'); }); } - Uri _encodeUrl(String baseUrl, - String appkey, - String accessToken, - Map params,) { + Uri _encodeUrl( + String baseUrl, + String appkey, + String accessToken, + Map params, + ) { params.putIfAbsent('source', () => appkey); params.putIfAbsent('access_token', () => accessToken); Uri baseUri = Uri.parse(baseUrl); Map> queryParametersAll = - Map>.of(baseUri.queryParametersAll); + Map>.of(baseUri.queryParametersAll); params.forEach((String key, String value) { queryParametersAll.remove(key); queryParametersAll.putIfAbsent(key, () => [value]);