import 'package:json_annotation/json_annotation.dart'; part 'wx_pay.g.dart'; @JsonSerializable(explicitToJson: true) class WxPay { String? appId = ''; String? nonceStr = ''; String? packageValue = ''; String? partnerId = ''; String? prepayId = ''; String? sign = ''; String? timeStamp = ''; WxPay(); factory WxPay.fromJson(Map json) => _$WxPayFromJson(json); Map toJson() => _$WxPayToJson(this); bool isAnyEmpty() { return (appId?.isEmpty ?? true) || (nonceStr?.isEmpty ?? true) || (packageValue?.isEmpty ?? true) || (partnerId?.isEmpty ?? true) || (prepayId?.isEmpty ?? true) || (sign?.isEmpty ?? true) || (timeStamp?.isEmpty ?? true); } }