m<K, V> method Null safety

void m<K, V>(
  1. int tagNumber,
  2. String name,
  3. {String? entryClassName,
  4. int? keyFieldType,
  5. int? valueFieldType,
  6. CreateBuilderFunc? valueCreator,
  7. ValueOfFunc? valueOf,
  8. List<ProtobufEnum>? enumValues,
  9. ProtobufEnum? defaultEnumValue,
  10. PackageName packageName = const PackageName(''),
  11. String? protoName}
)

Implementation

void m<K, V>(int tagNumber, String name,
    {String? entryClassName,
    int? keyFieldType,
    int? valueFieldType,
    CreateBuilderFunc? valueCreator,
    ValueOfFunc? valueOf,
    List<ProtobufEnum>? enumValues,
    ProtobufEnum? defaultEnumValue,
    PackageName packageName = const PackageName(''),
    String? protoName}) {
  var mapEntryBuilderInfo = BuilderInfo(entryClassName, package: packageName)
    ..add(PbMap._keyFieldNumber, 'key', keyFieldType, null, null, null, null)
    ..add(PbMap._valueFieldNumber, 'value', valueFieldType, null,
        valueCreator, valueOf, enumValues);

  addMapField<K, V>(tagNumber, name, keyFieldType, valueFieldType,
      mapEntryBuilderInfo, valueCreator,
      defaultEnumValue: defaultEnumValue, protoName: protoName);
}