removeHeader method Null safety

void removeHeader(
  1. String name
)

Removes the header with the specified name.

Implementation

void removeHeader(String name) {
  headers ??= <Header>[];
  final lowerCaseName = name.toLowerCase();
  headers!.removeWhere((h) => h.lowerCaseName == lowerCaseName);
}