encode<V> static method

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

Implementation

static V encode<V>(
  CustomerSessionComponents instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.buyButton != null) {
    PortalSubscriptionPause.encode(
      instance.buyButton!,
      container.nestedSingleValueContainer('buy_button').encoder,
    );
  }
  if (instance.pricingTable != null) {
    PortalSubscriptionPause.encode(
      instance.pricingTable!,
      container.nestedSingleValueContainer('pricing_table').encoder,
    );
  }
  return container.value;
}