transformToHtml method
Transforms this message to HTML code.
Set blockExternalImages
to true
in case external images
should be blocked.
Set preferPlainText
to true
to use plain text instead of the
HTML text.
Set enableDarkMode
to true
to enforce dark mode on devices with
older browsers.
Optionally specify the maxImageWidth
to set the maximum width for
embedded images.
Optionally specify the emptyMessageText
for messages that contain no
other content.
Optionally specify the transformConfiguration
to control all aspects
of the transformation - in that case other parameters are ignored.
Implementation
String transformToHtml({
bool blockExternalImages = false,
bool preferPlainText = false,
bool enableDarkMode = false,
int? maxImageWidth,
String? emptyMessageText,
TransformConfiguration? transformConfiguration,
}) {
final document = transformToDocument(
blockExternalImages: blockExternalImages,
preferPlainText: preferPlainText,
enableDarkMode: enableDarkMode,
maxImageWidth: maxImageWidth,
emptyMessageText: emptyMessageText,
transformConfiguration: transformConfiguration,
);
return document.outerHtml;
}