mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-06-13 04:48:19 +08:00
优化
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
## 2.0.1
|
||||||
|
|
||||||
|
* 优化
|
||||||
|
|
||||||
## 2.0.0
|
## 2.0.0
|
||||||
|
|
||||||
* 升级 Android/iOS 接口
|
* 升级 Android/iOS 接口
|
||||||
|
18
analysis_options.yaml
Executable file → Normal file
18
analysis_options.yaml
Executable file → Normal file
@ -29,6 +29,9 @@ analyzer:
|
|||||||
missing_return: warning
|
missing_return: warning
|
||||||
# allow having TODOs in the code
|
# allow having TODOs in the code
|
||||||
todo: ignore
|
todo: ignore
|
||||||
|
# allow self-reference to deprecated members (we do this because otherwise we have
|
||||||
|
# to annotate every member in every test, assert, etc, when we deprecate something)
|
||||||
|
deprecated_member_use_from_same_package: ignore
|
||||||
# Ignore analyzer hints for updating pubspecs when using Future or
|
# Ignore analyzer hints for updating pubspecs when using Future or
|
||||||
# Stream and not importing dart:async
|
# Stream and not importing dart:async
|
||||||
# Please see https://github.com/flutter/flutter/pull/24528 for details.
|
# Please see https://github.com/flutter/flutter/pull/24528 for details.
|
||||||
@ -55,7 +58,7 @@ linter:
|
|||||||
- avoid_classes_with_only_static_members
|
- avoid_classes_with_only_static_members
|
||||||
# - avoid_double_and_int_checks # only useful when targeting JS runtime
|
# - avoid_double_and_int_checks # only useful when targeting JS runtime
|
||||||
- avoid_empty_else
|
- avoid_empty_else
|
||||||
# - avoid_equals_and_hash_code_on_mutable_classes # not yet tested
|
- avoid_equals_and_hash_code_on_mutable_classes
|
||||||
- avoid_field_initializers_in_const_classes
|
- avoid_field_initializers_in_const_classes
|
||||||
- avoid_function_literals_in_foreach_calls
|
- avoid_function_literals_in_foreach_calls
|
||||||
# - avoid_implementing_value_types # not yet tested
|
# - avoid_implementing_value_types # not yet tested
|
||||||
@ -98,7 +101,7 @@ linter:
|
|||||||
- empty_catches
|
- empty_catches
|
||||||
- empty_constructor_bodies
|
- empty_constructor_bodies
|
||||||
- empty_statements
|
- empty_statements
|
||||||
# - file_names # not yet tested
|
- file_names
|
||||||
- flutter_style_todos
|
- flutter_style_todos
|
||||||
- hash_and_equals
|
- hash_and_equals
|
||||||
- implementation_imports
|
- implementation_imports
|
||||||
@ -139,14 +142,14 @@ linter:
|
|||||||
# - prefer_double_quotes # opposite of prefer_single_quotes
|
# - prefer_double_quotes # opposite of prefer_single_quotes
|
||||||
- prefer_equal_for_default_values
|
- prefer_equal_for_default_values
|
||||||
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
|
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
|
||||||
# - prefer_final_fields
|
- prefer_final_fields
|
||||||
# - prefer_final_in_for_each
|
# - prefer_final_in_for_each
|
||||||
# - prefer_final_locals
|
# - prefer_final_locals
|
||||||
- prefer_for_elements_to_map_fromIterable
|
- prefer_for_elements_to_map_fromIterable
|
||||||
- prefer_foreach
|
# - prefer_foreach
|
||||||
# - prefer_function_declarations_over_variables # not yet tested
|
# - prefer_function_declarations_over_variables # not yet tested
|
||||||
- prefer_generic_function_type_aliases
|
- prefer_generic_function_type_aliases
|
||||||
- prefer_if_elements_to_conditional_expressions
|
# - prefer_if_elements_to_conditional_expressions
|
||||||
- prefer_if_null_operators
|
- prefer_if_null_operators
|
||||||
- prefer_initializing_formals
|
- prefer_initializing_formals
|
||||||
- prefer_inlined_adds
|
- prefer_inlined_adds
|
||||||
@ -175,7 +178,7 @@ linter:
|
|||||||
- throw_in_finally
|
- throw_in_finally
|
||||||
# - type_annotate_public_apis # subset of always_specify_types
|
# - type_annotate_public_apis # subset of always_specify_types
|
||||||
- type_init_formals
|
- type_init_formals
|
||||||
# - unawaited_futures # too many false positives
|
- unawaited_futures # too many false positives
|
||||||
# - unnecessary_await_in_return # not yet tested
|
# - unnecessary_await_in_return # not yet tested
|
||||||
- unnecessary_brace_in_string_interps
|
- unnecessary_brace_in_string_interps
|
||||||
- unnecessary_const
|
- unnecessary_const
|
||||||
@ -195,9 +198,10 @@ linter:
|
|||||||
- use_full_hex_values_for_flutter_colors
|
- use_full_hex_values_for_flutter_colors
|
||||||
# - use_function_type_syntax_for_parameters # not yet tested
|
# - use_function_type_syntax_for_parameters # not yet tested
|
||||||
# - use_key_in_widget_constructors # not yet tested
|
# - use_key_in_widget_constructors # not yet tested
|
||||||
|
- use_late_for_private_fields_and_variables
|
||||||
- use_rethrow_when_possible
|
- use_rethrow_when_possible
|
||||||
# - use_setters_to_change_properties # not yet tested
|
# - use_setters_to_change_properties # not yet tested
|
||||||
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
|
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
|
||||||
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
|
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
|
||||||
- valid_regexps
|
- valid_regexps
|
||||||
- void_checks
|
- void_checks
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
group 'io.github.v7lin.tencent_kit'
|
group 'io.github.v7lin.tencent_kit'
|
||||||
version '2.0.0'
|
version '2.0.1'
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -2,10 +2,10 @@ PODS:
|
|||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- path_provider (0.0.1):
|
- path_provider (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- tencent_kit (2.0.0):
|
- tencent_kit (2.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- tencent_kit/vendor (= 2.0.0)
|
- tencent_kit/vendor (= 2.0.1)
|
||||||
- tencent_kit/vendor (2.0.0):
|
- tencent_kit/vendor (2.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
@ -24,7 +24,7 @@ EXTERNAL SOURCES:
|
|||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
|
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
|
||||||
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
|
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
|
||||||
tencent_kit: 204825086150a020041a395f3ea6202964dd313f
|
tencent_kit: 355aba785f79136a1a8800d159ed25a6d776d928
|
||||||
|
|
||||||
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
|
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
|
||||||
|
|
||||||
|
@ -90,14 +90,14 @@ class _HomeState extends State<Home> {
|
|||||||
title: const Text('获取用户信息'),
|
title: const Text('获取用户信息'),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (_loginResp != null &&
|
if (_loginResp != null &&
|
||||||
_loginResp.isSuccessful() &&
|
_loginResp.isSuccessful &&
|
||||||
!_loginResp.isExpired()) {
|
!_loginResp.isExpired) {
|
||||||
TencentUserInfoResp userInfo = await _tencent.getUserInfo(
|
TencentUserInfoResp userInfo = await _tencent.getUserInfo(
|
||||||
appId: _TENCENT_APPID,
|
appId: _TENCENT_APPID,
|
||||||
openid: _loginResp.openid,
|
openid: _loginResp.openid,
|
||||||
accessToken: _loginResp.accessToken,
|
accessToken: _loginResp.accessToken,
|
||||||
);
|
);
|
||||||
if (userInfo.isSuccessful()) {
|
if (userInfo.isSuccessful) {
|
||||||
_showTips('用户信息',
|
_showTips('用户信息',
|
||||||
'${userInfo.nickname} - ${userInfo.gender} - ${userInfo.genderType}');
|
'${userInfo.nickname} - ${userInfo.gender} - ${userInfo.genderType}');
|
||||||
} else {
|
} else {
|
||||||
@ -110,12 +110,12 @@ class _HomeState extends State<Home> {
|
|||||||
title: const Text('获取UnionID'),
|
title: const Text('获取UnionID'),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (_loginResp != null &&
|
if (_loginResp != null &&
|
||||||
_loginResp.isSuccessful() &&
|
_loginResp.isSuccessful &&
|
||||||
!_loginResp.isExpired()) {
|
!_loginResp.isExpired) {
|
||||||
TencentUnionidResp unionid = await _tencent.getUnionId(
|
TencentUnionidResp unionid = await _tencent.getUnionId(
|
||||||
accessToken: _loginResp.accessToken,
|
accessToken: _loginResp.accessToken,
|
||||||
);
|
);
|
||||||
if (unionid.isSuccessful()) {
|
if (unionid.isSuccessful) {
|
||||||
_showTips('UnionID',
|
_showTips('UnionID',
|
||||||
'${unionid.clientId} - ${unionid.openid} - ${unionid.unionid}');
|
'${unionid.clientId} - ${unionid.openid} - ${unionid.unionid}');
|
||||||
} else {
|
} else {
|
||||||
|
@ -246,7 +246,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "2.0.0"
|
version: "2.0.1"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = 'tencent_kit'
|
s.name = 'tencent_kit'
|
||||||
s.version = '2.0.0'
|
s.version = '2.0.1'
|
||||||
s.summary = 'A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Tencent SDKs.'
|
s.summary = 'A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Tencent SDKs.'
|
||||||
s.description = <<-DESC
|
s.description = <<-DESC
|
||||||
A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Tencent SDKs.
|
A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Tencent SDKs.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
abstract class TencentApiResp {
|
abstract class TencentApiResp {
|
||||||
TencentApiResp({
|
const TencentApiResp({
|
||||||
this.ret,
|
this.ret,
|
||||||
this.msg,
|
this.msg,
|
||||||
});
|
});
|
||||||
@ -16,5 +16,5 @@ abstract class TencentApiResp {
|
|||||||
final int ret;
|
final int ret;
|
||||||
final String msg;
|
final String msg;
|
||||||
|
|
||||||
bool isSuccessful() => ret == RET_SUCCESS;
|
bool get isSuccessful => ret == RET_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -4,12 +4,11 @@ import 'package:tencent_kit/src/model/api/tencent_api_resp.dart';
|
|||||||
part 'tencent_user_info_resp.g.dart';
|
part 'tencent_user_info_resp.g.dart';
|
||||||
|
|
||||||
@JsonSerializable(
|
@JsonSerializable(
|
||||||
anyMap: true,
|
|
||||||
explicitToJson: true,
|
explicitToJson: true,
|
||||||
fieldRename: FieldRename.snake,
|
fieldRename: FieldRename.snake,
|
||||||
)
|
)
|
||||||
class TencentUserInfoResp extends TencentApiResp {
|
class TencentUserInfoResp extends TencentApiResp {
|
||||||
TencentUserInfoResp({
|
const TencentUserInfoResp({
|
||||||
int ret,
|
int ret,
|
||||||
String msg,
|
String msg,
|
||||||
this.isLost,
|
this.isLost,
|
||||||
@ -34,7 +33,7 @@ class TencentUserInfoResp extends TencentApiResp {
|
|||||||
this.isYellowYearVip,
|
this.isYellowYearVip,
|
||||||
}) : super(ret: ret, msg: msg);
|
}) : super(ret: ret, msg: msg);
|
||||||
|
|
||||||
factory TencentUserInfoResp.fromJson(Map<dynamic, dynamic> json) =>
|
factory TencentUserInfoResp.fromJson(Map<String, dynamic> json) =>
|
||||||
_$TencentUserInfoRespFromJson(json);
|
_$TencentUserInfoRespFromJson(json);
|
||||||
|
|
||||||
final int isLost;
|
final int isLost;
|
||||||
@ -71,15 +70,11 @@ class TencentUserInfoResp extends TencentApiResp {
|
|||||||
final String level;
|
final String level;
|
||||||
final String isYellowYearVip;
|
final String isYellowYearVip;
|
||||||
|
|
||||||
bool isMale() {
|
bool get isMale => gender == '男';
|
||||||
return gender == '男';
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isFemale() {
|
bool get isFemale => gender == '女';
|
||||||
return gender == '女';
|
|
||||||
}
|
|
||||||
|
|
||||||
String headImgUrl() {
|
String get headImgUrl {
|
||||||
if (figureurlQq != null && figureurlQq.isNotEmpty) {
|
if (figureurlQq != null && figureurlQq.isNotEmpty) {
|
||||||
return figureurlQq;
|
return figureurlQq;
|
||||||
}
|
}
|
||||||
@ -98,5 +93,5 @@ class TencentUserInfoResp extends TencentApiResp {
|
|||||||
return figureurl;
|
return figureurl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<dynamic, dynamic> toJson() => _$TencentUserInfoRespToJson(this);
|
Map<String, dynamic> toJson() => _$TencentUserInfoRespToJson(this);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ part of 'tencent_user_info_resp.dart';
|
|||||||
// JsonSerializableGenerator
|
// JsonSerializableGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
TencentUserInfoResp _$TencentUserInfoRespFromJson(Map json) {
|
TencentUserInfoResp _$TencentUserInfoRespFromJson(Map<String, dynamic> json) {
|
||||||
return TencentUserInfoResp(
|
return TencentUserInfoResp(
|
||||||
ret: json['ret'] as int ?? 0,
|
ret: json['ret'] as int ?? 0,
|
||||||
msg: json['msg'] as String,
|
msg: json['msg'] as String,
|
||||||
|
@ -4,12 +4,11 @@ import 'package:tencent_kit/src/model/sdk/tencent_sdk_resp.dart';
|
|||||||
part 'tencent_login_resp.g.dart';
|
part 'tencent_login_resp.g.dart';
|
||||||
|
|
||||||
@JsonSerializable(
|
@JsonSerializable(
|
||||||
anyMap: true,
|
|
||||||
explicitToJson: true,
|
explicitToJson: true,
|
||||||
fieldRename: FieldRename.snake,
|
fieldRename: FieldRename.snake,
|
||||||
)
|
)
|
||||||
class TencentLoginResp extends TencentSdkResp {
|
class TencentLoginResp extends TencentSdkResp {
|
||||||
TencentLoginResp({
|
const TencentLoginResp({
|
||||||
int ret,
|
int ret,
|
||||||
String msg,
|
String msg,
|
||||||
this.openid,
|
this.openid,
|
||||||
@ -18,7 +17,7 @@ class TencentLoginResp extends TencentSdkResp {
|
|||||||
this.createAt,
|
this.createAt,
|
||||||
}) : super(ret: ret, msg: msg);
|
}) : super(ret: ret, msg: msg);
|
||||||
|
|
||||||
factory TencentLoginResp.fromJson(Map<dynamic, dynamic> json) =>
|
factory TencentLoginResp.fromJson(Map<String, dynamic> json) =>
|
||||||
_$TencentLoginRespFromJson(json);
|
_$TencentLoginRespFromJson(json);
|
||||||
|
|
||||||
final String openid;
|
final String openid;
|
||||||
@ -26,9 +25,7 @@ class TencentLoginResp extends TencentSdkResp {
|
|||||||
final int expiresIn;
|
final int expiresIn;
|
||||||
final int createAt;
|
final int createAt;
|
||||||
|
|
||||||
bool isExpired() {
|
bool get isExpired => DateTime.now().millisecondsSinceEpoch - createAt >= expiresIn * 1000;
|
||||||
return DateTime.now().millisecondsSinceEpoch - createAt >= expiresIn * 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<dynamic, dynamic> toJson() => _$TencentLoginRespToJson(this);
|
Map<String, dynamic> toJson() => _$TencentLoginRespToJson(this);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ part of 'tencent_login_resp.dart';
|
|||||||
// JsonSerializableGenerator
|
// JsonSerializableGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
TencentLoginResp _$TencentLoginRespFromJson(Map json) {
|
TencentLoginResp _$TencentLoginRespFromJson(Map<String, dynamic> json) {
|
||||||
return TencentLoginResp(
|
return TencentLoginResp(
|
||||||
ret: json['ret'] as int ?? 0,
|
ret: json['ret'] as int ?? 0,
|
||||||
msg: json['msg'] as String,
|
msg: json['msg'] as String,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
abstract class TencentSdkResp {
|
abstract class TencentSdkResp {
|
||||||
TencentSdkResp({
|
const TencentSdkResp({
|
||||||
this.ret,
|
this.ret,
|
||||||
this.msg,
|
this.msg,
|
||||||
});
|
});
|
||||||
@ -23,5 +23,7 @@ abstract class TencentSdkResp {
|
|||||||
final int ret;
|
final int ret;
|
||||||
final String msg;
|
final String msg;
|
||||||
|
|
||||||
bool isSuccessful() => ret == RET_SUCCESS;
|
bool get isSuccessful => ret == RET_SUCCESS;
|
||||||
|
|
||||||
|
bool get isCancelled => ret == RET_USERCANCEL;
|
||||||
}
|
}
|
||||||
|
@ -4,18 +4,17 @@ import 'package:tencent_kit/src/model/sdk/tencent_sdk_resp.dart';
|
|||||||
part 'tencent_share_resp.g.dart';
|
part 'tencent_share_resp.g.dart';
|
||||||
|
|
||||||
@JsonSerializable(
|
@JsonSerializable(
|
||||||
anyMap: true,
|
|
||||||
explicitToJson: true,
|
explicitToJson: true,
|
||||||
fieldRename: FieldRename.snake,
|
fieldRename: FieldRename.snake,
|
||||||
)
|
)
|
||||||
class TencentShareResp extends TencentSdkResp {
|
class TencentShareResp extends TencentSdkResp {
|
||||||
TencentShareResp({
|
const TencentShareResp({
|
||||||
int ret,
|
int ret,
|
||||||
String msg,
|
String msg,
|
||||||
}) : super(ret: ret, msg: msg);
|
}) : super(ret: ret, msg: msg);
|
||||||
|
|
||||||
factory TencentShareResp.fromJson(Map<dynamic, dynamic> json) =>
|
factory TencentShareResp.fromJson(Map<String, dynamic> json) =>
|
||||||
_$TencentShareRespFromJson(json);
|
_$TencentShareRespFromJson(json);
|
||||||
|
|
||||||
Map<dynamic, dynamic> toJson() => _$TencentShareRespToJson(this);
|
Map<String, dynamic> toJson() => _$TencentShareRespToJson(this);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ part of 'tencent_share_resp.dart';
|
|||||||
// JsonSerializableGenerator
|
// JsonSerializableGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
TencentShareResp _$TencentShareRespFromJson(Map json) {
|
TencentShareResp _$TencentShareRespFromJson(Map<String, dynamic> json) {
|
||||||
return TencentShareResp(
|
return TencentShareResp(
|
||||||
ret: json['ret'] as int ?? 0,
|
ret: json['ret'] as int ?? 0,
|
||||||
msg: json['msg'] as String,
|
msg: json['msg'] as String,
|
||||||
|
@ -3,12 +3,11 @@ import 'package:json_annotation/json_annotation.dart';
|
|||||||
part 'tencent_unionid_resp.g.dart';
|
part 'tencent_unionid_resp.g.dart';
|
||||||
|
|
||||||
@JsonSerializable(
|
@JsonSerializable(
|
||||||
anyMap: true,
|
|
||||||
explicitToJson: true,
|
explicitToJson: true,
|
||||||
fieldRename: FieldRename.snake,
|
fieldRename: FieldRename.snake,
|
||||||
)
|
)
|
||||||
class TencentUnionidResp {
|
class TencentUnionidResp {
|
||||||
TencentUnionidResp({
|
const TencentUnionidResp({
|
||||||
this.error,
|
this.error,
|
||||||
this.errorDescription,
|
this.errorDescription,
|
||||||
this.clientId,
|
this.clientId,
|
||||||
@ -16,7 +15,7 @@ class TencentUnionidResp {
|
|||||||
this.unionid,
|
this.unionid,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory TencentUnionidResp.fromJson(Map<dynamic, dynamic> json) =>
|
factory TencentUnionidResp.fromJson(Map<String, dynamic> json) =>
|
||||||
_$TencentUnionidRespFromJson(json);
|
_$TencentUnionidRespFromJson(json);
|
||||||
|
|
||||||
@JsonKey(
|
@JsonKey(
|
||||||
@ -30,7 +29,7 @@ class TencentUnionidResp {
|
|||||||
|
|
||||||
static const int ERROR_SUCCESS = 0;
|
static const int ERROR_SUCCESS = 0;
|
||||||
|
|
||||||
bool isSuccessful() => error == ERROR_SUCCESS;
|
bool get isSuccessful => error == ERROR_SUCCESS;
|
||||||
|
|
||||||
Map<dynamic, dynamic> toJson() => _$TencentUnionidRespToJson(this);
|
Map<String, dynamic> toJson() => _$TencentUnionidRespToJson(this);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ part of 'tencent_unionid_resp.dart';
|
|||||||
// JsonSerializableGenerator
|
// JsonSerializableGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
TencentUnionidResp _$TencentUnionidRespFromJson(Map json) {
|
TencentUnionidResp _$TencentUnionidRespFromJson(Map<String, dynamic> json) {
|
||||||
return TencentUnionidResp(
|
return TencentUnionidResp(
|
||||||
error: json['error'] as int ?? 0,
|
error: json['error'] as int ?? 0,
|
||||||
errorDescription: json['error_description'] as String,
|
errorDescription: json['error_description'] as String,
|
||||||
|
@ -60,11 +60,11 @@ class Tencent {
|
|||||||
switch (call.method) {
|
switch (call.method) {
|
||||||
case _METHOD_ONLOGINRESP:
|
case _METHOD_ONLOGINRESP:
|
||||||
_loginRespStreamController.add(
|
_loginRespStreamController.add(
|
||||||
TencentLoginResp.fromJson(call.arguments as Map<dynamic, dynamic>));
|
TencentLoginResp.fromJson((call.arguments as Map<dynamic, dynamic>).cast<String, dynamic>()));
|
||||||
break;
|
break;
|
||||||
case _METHOD_ONSHARERESP:
|
case _METHOD_ONSHARERESP:
|
||||||
_shareRespStreamController.add(
|
_shareRespStreamController.add(
|
||||||
TencentShareResp.fromJson(call.arguments as Map<dynamic, dynamic>));
|
TencentShareResp.fromJson((call.arguments as Map<dynamic, dynamic>).cast<String, dynamic>()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ class Tencent {
|
|||||||
Encoding encoding = Encoding.getByName(contentType?.charset) ?? utf8;
|
Encoding encoding = Encoding.getByName(contentType?.charset) ?? utf8;
|
||||||
String content = await encoding.decodeStream(response);
|
String content = await encoding.decodeStream(response);
|
||||||
return TencentUserInfoResp.fromJson(
|
return TencentUserInfoResp.fromJson(
|
||||||
json.decode(content) as Map<dynamic, dynamic>);
|
json.decode(content) as Map<String, dynamic>);
|
||||||
}
|
}
|
||||||
throw HttpException(
|
throw HttpException(
|
||||||
'HttpResponse statusCode: ${response.statusCode}, reasonPhrase: ${response.reasonPhrase}.');
|
'HttpResponse statusCode: ${response.statusCode}, reasonPhrase: ${response.reasonPhrase}.');
|
||||||
@ -174,7 +174,7 @@ class Tencent {
|
|||||||
if (match.groupCount == 1) {
|
if (match.groupCount == 1) {
|
||||||
String content = match.group(1);
|
String content = match.group(1);
|
||||||
return TencentUnionidResp.fromJson(
|
return TencentUnionidResp.fromJson(
|
||||||
json.decode(content) as Map<dynamic, dynamic>);
|
json.decode(content) as Map<String, dynamic>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw HttpException(
|
throw HttpException(
|
||||||
|
108
pubspec.lock
108
pubspec.lock
@ -7,14 +7,14 @@ packages:
|
|||||||
name: _fe_analyzer_shared
|
name: _fe_analyzer_shared
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "14.0.0"
|
||||||
analyzer:
|
analyzer:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: analyzer
|
name: analyzer
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.39.10"
|
version: "0.41.2"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -42,42 +42,42 @@ packages:
|
|||||||
name: build
|
name: build
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.6.1"
|
||||||
build_config:
|
build_config:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_config
|
name: build_config
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.2"
|
version: "0.4.5"
|
||||||
build_daemon:
|
build_daemon:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_daemon
|
name: build_daemon
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.6"
|
||||||
build_resolvers:
|
build_resolvers:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_resolvers
|
name: build_resolvers
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.9"
|
version: "1.5.2"
|
||||||
build_runner:
|
build_runner:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: build_runner
|
name: build_runner
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
version: "1.11.0"
|
||||||
build_runner_core:
|
build_runner_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_runner_core
|
name: build_runner_core
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.2.0"
|
version: "6.1.6"
|
||||||
built_collection:
|
built_collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -112,7 +112,14 @@ packages:
|
|||||||
name: checked_yaml
|
name: checked_yaml
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.4"
|
||||||
|
cli_util:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cli_util
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -126,7 +133,7 @@ packages:
|
|||||||
name: code_builder
|
name: code_builder
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.0"
|
version: "3.6.0"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -147,21 +154,14 @@ packages:
|
|||||||
name: crypto
|
name: crypto
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.5"
|
||||||
csslib:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: csslib
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "0.16.1"
|
|
||||||
dart_style:
|
dart_style:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: dart_style
|
name: dart_style
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.6"
|
version: "1.3.11"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -169,13 +169,20 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0-nullsafety.1"
|
version: "1.2.0-nullsafety.1"
|
||||||
|
ffi:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: ffi
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.3"
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file
|
name: file
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.2.0"
|
version: "5.2.1"
|
||||||
fixnum:
|
fixnum:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -207,13 +214,6 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.0"
|
version: "0.2.0"
|
||||||
html:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: html
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "0.14.0+3"
|
|
||||||
http_multi_server:
|
http_multi_server:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -255,14 +255,14 @@ packages:
|
|||||||
name: json_annotation
|
name: json_annotation
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
version: "3.1.1"
|
||||||
json_serializable:
|
json_serializable:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: json_serializable
|
name: json_serializable
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.0"
|
version: "3.5.1"
|
||||||
logging:
|
logging:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -290,21 +290,21 @@ packages:
|
|||||||
name: mime
|
name: mime
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.6+3"
|
version: "0.9.7"
|
||||||
node_interop:
|
node_interop:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: node_interop
|
name: node_interop
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.2.1"
|
||||||
node_io:
|
node_io:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: node_io
|
name: node_io
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.2.0"
|
||||||
okhttp_kit:
|
okhttp_kit:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@ -332,35 +332,42 @@ packages:
|
|||||||
name: path_provider
|
name: path_provider
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.6.10"
|
version: "1.6.27"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_linux
|
name: path_provider_linux
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.1+1"
|
version: "0.0.1+2"
|
||||||
path_provider_macos:
|
path_provider_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_macos
|
name: path_provider_macos
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.4+3"
|
version: "0.0.4+8"
|
||||||
path_provider_platform_interface:
|
path_provider_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_platform_interface
|
name: path_provider_platform_interface
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.4"
|
||||||
|
path_provider_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_windows
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.4+3"
|
||||||
pedantic:
|
pedantic:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: pedantic
|
name: pedantic
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "1.9.2"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -374,7 +381,7 @@ packages:
|
|||||||
name: plugin_platform_interface
|
name: plugin_platform_interface
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.3"
|
||||||
pool:
|
pool:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -402,28 +409,28 @@ packages:
|
|||||||
name: pubspec_parse
|
name: pubspec_parse
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.5"
|
version: "0.1.7"
|
||||||
quiver:
|
quiver:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: quiver
|
name: quiver
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.3"
|
version: "2.1.5"
|
||||||
shelf:
|
shelf:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shelf
|
name: shelf
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.5"
|
version: "0.7.9"
|
||||||
shelf_web_socket:
|
shelf_web_socket:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shelf_web_socket
|
name: shelf_web_socket
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.3"
|
version: "0.2.4"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@ -435,7 +442,7 @@ packages:
|
|||||||
name: source_gen
|
name: source_gen
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.5"
|
version: "0.9.10+1"
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -491,7 +498,7 @@ packages:
|
|||||||
name: timing
|
name: timing
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.1+2"
|
version: "0.1.1+3"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -519,14 +526,21 @@ packages:
|
|||||||
name: web_socket_channel
|
name: web_socket_channel
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0"
|
||||||
|
win32:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: win32
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.7.4+1"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: xdg_directories
|
name: xdg_directories
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.0"
|
version: "0.1.2"
|
||||||
yaml:
|
yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -535,5 +549,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.1"
|
version: "2.2.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.10.0-110 <2.11.0"
|
dart: ">=2.10.0 <2.11.0"
|
||||||
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: tencent_kit
|
name: tencent_kit
|
||||||
description: A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Tencent SDKs.
|
description: A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Tencent SDKs.
|
||||||
version: 2.0.0
|
version: 2.0.1
|
||||||
# author: v7lin <v7lin@qq.com>
|
# author: v7lin <v7lin@qq.com>
|
||||||
homepage: https://github.com/v7lin/fake_tencent
|
homepage: https://github.com/v7lin/fake_tencent
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user