toPublic method

Part toPublic()

Implementation

public_types.Part toPublic(){
  if(this is InternalTextPart){
    final t = this as InternalTextPart;
    return public_types.TextPart(t.text);
  } else if(this is InternalBlobPart){
    final t = this as InternalBlobPart;
    return public_types.BlobPart(t.inlineData.mimeType,base64Decode(t.inlineData.data));
  } else {
    throw public_types.SerializationException(
        "The given subclass of Part (${runtimeType.toString()}) is not supported in the serialization yet."
    );
  }
}