ParameterizedHeader constructor Null safety

ParameterizedHeader(
  1. String rawValue
)

Implementation

ParameterizedHeader(this.rawValue) {
  final elements = rawValue.split(';');
  value = elements[0];
  for (var i = 1; i < elements.length; i++) {
    final element = elements[i].trim();
    final splitPos = element.indexOf('=');
    if (splitPos == -1) {
      parameters[element.toLowerCase()] = '';
    } else {
      final name = element.substring(0, splitPos).toLowerCase();
      final value = element.substring(splitPos + 1);
      final valueWithoutQuotes = removeQuotes(value);
      parameters[name] = valueWithoutQuotes;
    }
  }
}