toText method

  1. @override
String toText()
override

Converts this image into a plain-text description.

The output includes the alt text, optional caption, and link URL if provided. Example:

[Image: Flint Dart Logo - Powered by Flint Dart] (https://flintdart.dev)

Implementation

@override
String toText() {
  final altText = alt ?? 'Image';
  final captionText = caption != null ? ' - $caption' : '';
  final linkText = linkUrl != null ? ' ($linkUrl)' : '';

  return '[Image: $altText$captionText]$linkText';
}