mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-07-02 11:06:37 +08:00
升级Flutter 3.0
This commit is contained in:
40
example/lib/api/model/tencent_unionid_resp.dart
Normal file
40
example/lib/api/model/tencent_unionid_resp.dart
Normal file
@ -0,0 +1,40 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'tencent_unionid_resp.g.dart';
|
||||
|
||||
@JsonSerializable(
|
||||
explicitToJson: true,
|
||||
fieldRename: FieldRename.snake,
|
||||
)
|
||||
class TencentUnionidResp {
|
||||
const TencentUnionidResp({
|
||||
required this.error,
|
||||
this.errorDescription,
|
||||
this.clientId,
|
||||
this.openid,
|
||||
this.unionid,
|
||||
});
|
||||
|
||||
factory TencentUnionidResp.fromJson(Map<String, dynamic> json) =>
|
||||
_$TencentUnionidRespFromJson(json);
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: ERROR_SUCCESS,
|
||||
)
|
||||
final int error;
|
||||
final String? errorDescription;
|
||||
final String? clientId;
|
||||
final String? openid;
|
||||
final String? unionid;
|
||||
|
||||
static const int ERROR_SUCCESS = 0;
|
||||
|
||||
bool get isSuccessful => error == ERROR_SUCCESS;
|
||||
|
||||
Map<String, dynamic> toJson() => _$TencentUnionidRespToJson(this);
|
||||
|
||||
@override
|
||||
String toString() => const JsonEncoder.withIndent(' ').convert(toJson());
|
||||
}
|
Reference in New Issue
Block a user