encode<V> static method

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

Implementation

static V encode<V>(
  Application instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeString(
    'id',
    instance.id,
  );
  if (instance.name != null) {
    container.encodeString(
      'name',
      instance.name!,
    );
  }
  container.encodeString(
    'object',
    'application',
  );
  return container.value;
}