AnyLinkPreview constructor

const AnyLinkPreview({
  1. Key? key,
  2. required String link,
  3. Duration cache = const Duration(days: 1),
  4. TextStyle? titleStyle,
  5. TextStyle? bodyStyle,
  6. UIDirection displayDirection = UIDirection.uiDirectionVertical,
  7. bool showMultimedia = true,
  8. Color? backgroundColor = const Color.fromRGBO(235, 235, 235, 1),
  9. int bodyMaxLines = 3,
  10. TextOverflow bodyTextOverflow = TextOverflow.ellipsis,
  11. Widget? placeholderWidget,
  12. Widget? errorWidget,
  13. String? errorBody,
  14. String? errorImage,
  15. String? errorTitle,
  16. double? borderRadius,
  17. List<BoxShadow>? boxShadow,
  18. bool removeElevation = false,
  19. String? proxyUrl,
  20. Map<String, String>? headers,
  21. VoidCallback? onTap,
  22. double? previewHeight,
  23. LaunchMode urlLaunchMode = LaunchMode.platformDefault,
  24. String? userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
})

Implementation

const AnyLinkPreview({
  super.key,
  required this.link,
  this.cache = const Duration(days: 1),
  this.titleStyle,
  this.bodyStyle,
  this.displayDirection = UIDirection.uiDirectionVertical,
  this.showMultimedia = true,
  this.backgroundColor = const Color.fromRGBO(235, 235, 235, 1),
  this.bodyMaxLines = 3,
  this.bodyTextOverflow = TextOverflow.ellipsis,
  this.placeholderWidget,
  this.errorWidget,
  this.errorBody,
  this.errorImage,
  this.errorTitle,
  this.borderRadius,
  this.boxShadow,
  this.removeElevation = false,
  this.proxyUrl,
  this.headers,
  this.onTap,
  this.previewHeight,
  this.urlLaunchMode = LaunchMode.platformDefault,
  this.userAgent =
      'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
}) : itemBuilder = null;