auto static method

Widget auto(
  1. String content, {
  2. bool? isUrl,
  3. double? height,
  4. bool enableFullscreen = false,
})

Auto-detect content type and create appropriate viewer

Parameters:

  • content: HTML content or URL
  • isUrl: Override auto-detection (optional)
  • height: Optional fixed height
  • enableFullscreen: Whether to enable fullscreen for URLs

Implementation

static Widget auto(
  String content, {
  bool? isUrl,
  double? height,
  bool enableFullscreen = false,
}) {
  final bool isUrlContent = isUrl ?? _isUrl(content);

  if (isUrlContent) {
    return url(
      content,
      showNavigationControls: true,
      height: height,
      enableFullscreen: enableFullscreen,
    );
  } else {
    return html(content, height: height);
  }
}