encode<V> static method

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

Implementation

static V encode<V>(
  ClimateRemovalsLocation instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.city != null) {
    container.encodeString(
      'city',
      instance.city!,
    );
  }
  container.encodeString(
    'country',
    instance.country,
  );
  if (instance.latitude != null) {
    container.encodeDouble(
      'latitude',
      instance.latitude!,
    );
  }
  if (instance.longitude != null) {
    container.encodeDouble(
      'longitude',
      instance.longitude!,
    );
  }
  if (instance.region != null) {
    container.encodeString(
      'region',
      instance.region!,
    );
  }
  return container.value;
}