encode<V> static method

V encode<V>(
  1. SourceTypeWechat instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  SourceTypeWechat instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.prepayId != null) {
    container.encodeString(
      'prepay_id',
      instance.prepayId!,
    );
  }
  if (instance.qrCodeUrl != null) {
    container.encodeString(
      'qr_code_url',
      instance.qrCodeUrl!,
    );
  }
  if (instance.statementDescriptor != null) {
    container.encodeString(
      'statement_descriptor',
      instance.statementDescriptor!,
    );
  }
  return container.value;
}