encode<V> static method

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

Implementation

static V encode<V>(
  GelatoSessionLastError instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.code != null) {
    container.encodeString(
      'code',
      instance.code!,
    );
  }
  if (instance.reason != null) {
    container.encodeString(
      'reason',
      instance.reason!,
    );
  }
  return container.value;
}