add<T> method Null safety

void add<T>(
  1. int tagNumber,
  2. String name,
  3. int? fieldType,
  4. dynamic defaultOrMaker,
  5. CreateBuilderFunc? subBuilder,
  6. ValueOfFunc? valueOf,
  7. List<ProtobufEnum>? enumValues,
  8. {String? protoName}
)

Implementation

void add<T>(
    int tagNumber,
    String name,
    int? fieldType,
    dynamic defaultOrMaker,
    CreateBuilderFunc? subBuilder,
    ValueOfFunc? valueOf,
    List<ProtobufEnum>? enumValues,
    {String? protoName}) {
  var index = byIndex.length;
  final fieldInfo = (tagNumber == 0)
      ? FieldInfo.dummy(index)
      : FieldInfo<T>(name, tagNumber, index, fieldType!,
          defaultOrMaker: defaultOrMaker,
          subBuilder: subBuilder,
          valueOf: valueOf,
          enumValues: enumValues,
          protoName: protoName);
  _addField(fieldInfo);
}