encode<V> static method

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

Implementation

static V encode<V>(
  Period instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.end != null) {
    container.encodeDateTime(
      'end',
      instance.end!,
    );
  }
  if (instance.start != null) {
    container.encodeDateTime(
      'start',
      instance.start!,
    );
  }
  return container.value;
}