encode<V> static method

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

Implementation

static V encode<V>(
  SourceOrderItem instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.amount != null) {
    container.encodeInt(
      'amount',
      instance.amount!,
    );
  }
  if (instance.currency != null) {
    container.encodeString(
      'currency',
      instance.currency!,
    );
  }
  if (instance.description != null) {
    container.encodeString(
      'description',
      instance.description!,
    );
  }
  if (instance.parent != null) {
    container.encodeString(
      'parent',
      instance.parent!,
    );
  }
  if (instance.quantity != null) {
    container.encodeInt(
      'quantity',
      instance.quantity!,
    );
  }
  if (instance.type != null) {
    container.encodeString(
      'type',
      instance.type!,
    );
  }
  return container.value;
}