LinkPreviewGenerator constructor

const LinkPreviewGenerator({
  1. Key? key,
  2. required String link,
  3. Duration cacheDuration = const Duration(days: 7),
  4. TextStyle? titleStyle,
  5. TextStyle? bodyStyle,
  6. LinkPreviewStyle linkPreviewStyle = LinkPreviewStyle.large,
  7. bool showBody = true,
  8. bool showDomain = true,
  9. bool showGraphic = true,
  10. bool showTitle = true,
  11. BoxFit graphicFit = BoxFit.cover,
  12. Color backgroundColor = const Color.fromRGBO(248, 248, 248, 1.0),
  13. int? bodyMaxLines,
  14. TextOverflow bodyTextOverflow = TextOverflow.ellipsis,
  15. void onTap()?,
  16. Widget? placeholderWidget,
  17. String? proxyUrl,
  18. Widget? errorWidget,
  19. String errorBody = 'Oops! Unable to parse the url.',
  20. String errorImage = 'https://raw.githubusercontent.com/ghpranav/link_preview_generator/main/assets/giphy.gif',
  21. String errorTitle = 'Something went wrong!',
  22. double borderRadius = 12.0,
  23. List<BoxShadow>? boxShadow,
  24. bool removeElevation = false,
})

Implementation

const LinkPreviewGenerator({
  Key? key,
  required this.link,
  this.cacheDuration = const Duration(days: 7),
  this.titleStyle,
  this.bodyStyle,
  this.linkPreviewStyle = LinkPreviewStyle.large,
  this.showBody = true,
  this.showDomain = true,
  this.showGraphic = true,
  this.showTitle = true,
  this.graphicFit = BoxFit.cover,
  this.backgroundColor = const Color.fromRGBO(248, 248, 248, 1.0),
  this.bodyMaxLines,
  this.bodyTextOverflow = TextOverflow.ellipsis,
  this.onTap,
  this.placeholderWidget,
  this.proxyUrl,
  this.errorWidget,
  this.errorBody = 'Oops! Unable to parse the url.',
  this.errorImage =
      'https://raw.githubusercontent.com/ghpranav/link_preview_generator/main/assets/giphy.gif',
  this.errorTitle = 'Something went wrong!',
  this.borderRadius = 12.0,
  this.boxShadow,
  this.removeElevation = false,
}) : super(key: key);