encode<V> static method

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

Implementation

static V encode<V>(
  SessionItemsItem instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeString(
    'id',
    instance.id,
  );
  if (instance.price != null) {
    container.encodeString(
      'price',
      instance.price!,
    );
  }
  if (instance.quantity != null) {
    container.encodeInt(
      'quantity',
      instance.quantity!,
    );
  }
  return container.value;
}