getEncoderFor<T> method

ExtraEncoder? getEncoderFor<T>(
  1. dynamic value
)

Implementation

ExtraEncoder? getEncoderFor<T>(dynamic value) {
  // ignore: prefer_typing_uninitialized_variables
  ExtraEncoder? chosenEncoder;

  for (var encoder in _encoders) {
    if (chosenEncoder == null) {
      if (encoder.match(value)) {
        chosenEncoder = encoder;
      }
    }
  }
  // if (chosenEncoder == null) {
  //   throw "Could not find an encoder for value.";
  // }
  return chosenEncoder;
}