addStringEncoder method Null safety

void addStringEncoder(
  1. String val,
  2. StringEncoder encoder
)

Implementation

void addStringEncoder(String val, StringEncoder encoder) {
  assert(val.length == 1);

  if (encoderMap.containsKey(val)) {
    throw ArgumentError('$val key is already mapped to an encoder!');
  }
  encoderMap[val] = encoder;
}