canEncodeCustom<T> method

  1. @override
bool canEncodeCustom<T>()
override

Checks if the encoder can encode the custom type T.

When this method returns true, the encodeObject method can be called with the type T.

Implementation

@override
bool canEncodeCustom<T>() {
  if (T == Reference) {
    return true;
  }
  if (_values is _AsyncEncodingValues && (T == Stream || T == Future)) {
    return true;
  }
  return false;
}