decodedType property Null safety

Type decodedType

The type of data bytes was decoded into.

Will throw an error if bytes have not been decoded yet.

Implementation

Type get decodedType {
  if (!hasBeenDecoded) {
    throw StateError(
      "Invalid body decoding. Must decode data prior to calling 'decodedType'.",
    );
  }

  return (_decodedData as Object?).runtimeType;
}