mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-05-21 17:26:59 +08:00
feature 5.0.0
This commit is contained in:
@ -6,32 +6,31 @@ part of 'tencent_api_resp.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
TencentUserInfoResp _$TencentUserInfoRespFromJson(Map<String, dynamic> json) {
|
||||
return TencentUserInfoResp(
|
||||
ret: json['ret'] as int? ?? 0,
|
||||
msg: json['msg'] as String?,
|
||||
isLost: json['is_lost'] as int?,
|
||||
nickname: json['nickname'] as String?,
|
||||
gender: json['gender'] as String?,
|
||||
genderType: json['gender_type'] as int?,
|
||||
province: json['province'] as String?,
|
||||
city: json['city'] as String?,
|
||||
year: json['year'] as String?,
|
||||
constellation: json['constellation'] as String?,
|
||||
figureurl: json['figureurl'] as String?,
|
||||
figureurl1: json['figureurl_1'] as String?,
|
||||
figureurl2: json['figureurl_2'] as String?,
|
||||
figureurlQq: json['figureurl_qq'] as String?,
|
||||
figureurlQq1: json['figureurl_qq_1'] as String?,
|
||||
figureurlQq2: json['figureurl_qq_2'] as String?,
|
||||
figureurlType: json['figureurl_type'] as String?,
|
||||
isYellowVip: json['is_yellow_vip'] as String?,
|
||||
vip: json['vip'] as String?,
|
||||
yellowVipLevel: json['yellow_vip_level'] as String?,
|
||||
level: json['level'] as String?,
|
||||
isYellowYearVip: json['is_yellow_year_vip'] as String?,
|
||||
);
|
||||
}
|
||||
TencentUserInfoResp _$TencentUserInfoRespFromJson(Map<String, dynamic> json) =>
|
||||
TencentUserInfoResp(
|
||||
ret: json['ret'] as int? ?? 0,
|
||||
msg: json['msg'] as String?,
|
||||
isLost: json['is_lost'] as int?,
|
||||
nickname: json['nickname'] as String?,
|
||||
gender: json['gender'] as String?,
|
||||
genderType: json['gender_type'] as int?,
|
||||
province: json['province'] as String?,
|
||||
city: json['city'] as String?,
|
||||
year: json['year'] as String?,
|
||||
constellation: json['constellation'] as String?,
|
||||
figureurl: json['figureurl'] as String?,
|
||||
figureurl1: json['figureurl_1'] as String?,
|
||||
figureurl2: json['figureurl_2'] as String?,
|
||||
figureurlQq: json['figureurl_qq'] as String?,
|
||||
figureurlQq1: json['figureurl_qq_1'] as String?,
|
||||
figureurlQq2: json['figureurl_qq_2'] as String?,
|
||||
figureurlType: json['figureurl_type'] as String?,
|
||||
isYellowVip: json['is_yellow_vip'] as String?,
|
||||
vip: json['vip'] as String?,
|
||||
yellowVipLevel: json['yellow_vip_level'] as String?,
|
||||
level: json['level'] as String?,
|
||||
isYellowYearVip: json['is_yellow_year_vip'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TencentUserInfoRespToJson(
|
||||
TencentUserInfoResp instance) =>
|
||||
|
@ -6,15 +6,14 @@ part of 'tencent_unionid_resp.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
TencentUnionidResp _$TencentUnionidRespFromJson(Map<String, dynamic> json) {
|
||||
return TencentUnionidResp(
|
||||
error: json['error'] as int? ?? 0,
|
||||
errorDescription: json['error_description'] as String?,
|
||||
clientId: json['client_id'] as String?,
|
||||
openid: json['openid'] as String?,
|
||||
unionid: json['unionid'] as String?,
|
||||
);
|
||||
}
|
||||
TencentUnionidResp _$TencentUnionidRespFromJson(Map<String, dynamic> json) =>
|
||||
TencentUnionidResp(
|
||||
error: json['error'] as int? ?? 0,
|
||||
errorDescription: json['error_description'] as String?,
|
||||
clientId: json['client_id'] as String?,
|
||||
openid: json['openid'] as String?,
|
||||
unionid: json['unionid'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TencentUnionidRespToJson(TencentUnionidResp instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -40,9 +40,9 @@ class Home extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _HomeState extends State<Home> {
|
||||
late final StreamSubscription<BaseResp> _respSubs;
|
||||
late final StreamSubscription<TencentResp> _respSubs;
|
||||
|
||||
LoginResp? _loginResp;
|
||||
TencentLoginResp? _loginResp;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -50,12 +50,12 @@ class _HomeState extends State<Home> {
|
||||
_respSubs = TencentKitPlatform.instance.respStream().listen(_listenLogin);
|
||||
}
|
||||
|
||||
void _listenLogin(BaseResp resp) {
|
||||
if (resp is LoginResp) {
|
||||
void _listenLogin(TencentResp resp) {
|
||||
if (resp is TencentLoginResp) {
|
||||
_loginResp = resp;
|
||||
final String content = 'login: ${resp.openid} - ${resp.accessToken}';
|
||||
_showTips('登录', content);
|
||||
} else if (resp is ShareMsgResp) {
|
||||
} else if (resp is TencentShareMsgResp) {
|
||||
final String content = 'share: ${resp.ret} - ${resp.msg}';
|
||||
_showTips('分享', content);
|
||||
}
|
||||
|
Reference in New Issue
Block a user