buildResponseParam1<S extends ResponseParam, V> function

S buildResponseParam1<S extends ResponseParam, V>(
  1. ServerRpcVersion? version,
  2. V arg, {
  3. String? label,
  4. Iterable<ParamBuilderEntry1<S, V>> versionBuilers = const [],
  5. required S nullVersionBuilder(
    1. V arg
    ),
  6. S defaultVersionBuilder(
    1. V arg
    )?,
})

Implementation

S buildResponseParam1<S extends ResponseParam, V>(
  ServerRpcVersion? version,
  V arg, {
  String? label,
  Iterable<ParamBuilderEntry1<S, V>> versionBuilers = const [],
  required S Function(V arg) nullVersionBuilder,
  S Function(V arg)? defaultVersionBuilder,
}) =>
    _buildParam(
      label: label,
      version: version,
      args: [arg],
      versionBuilers: versionBuilers
          .map((e) => MapEntry(e.key, (args) => e.value(args[0]))),
      nullVersionBuilder: (args) => nullVersionBuilder(args.first),
      defaultVersionBuilder: defaultVersionBuilder != null
          ? (args) => defaultVersionBuilder(args.first)
          : null,
    );