renderVariantIDL static method

dynamic renderVariantIDL(
  1. String type,
  2. Iterable<SerField> fields
)

Implementation

static renderVariantIDL(String type, Iterable<SerField> fields) {
  return (LambdaContext _) => """
  static final VariantClass idl = IDL.Variant(<String, CType<dynamic>>{
    ${fields.map((e) => "'${e.id}': ${e.idl},").join("\n")}
  },);
  """;
}