BloomRpcContract<TInput, TOutput> constructor

const BloomRpcContract<TInput, TOutput>({
  1. required BloomHttpMethod method,
  2. required String pathTemplate,
  3. dynamic encodeInput(
    1. TInput input
    )?,
  4. TInput decodeInput(
    1. dynamic json
    )?,
  5. dynamic encodeOutput(
    1. TOutput output
    )?,
  6. TOutput decodeOutput(
    1. dynamic json
    )?,
  7. String? summary,
  8. String? description,
  9. List customCacheKey(
    1. TInput input
    )?,
})

Creates a BloomRpcContract with explicit method, pathTemplate, and codecs.

const getUser = BloomRpcContract<void, User>(
  method: BloomHttpMethod.get,
  pathTemplate: '/users/:id',
  decodeOutput: User.fromJson,
);

Implementation

const BloomRpcContract({
  required this.method,
  required this.pathTemplate,
  this.encodeInput,
  this.decodeInput,
  this.encodeOutput,
  this.decodeOutput,
  this.summary,
  this.description,
  this.customCacheKey,
});