LinkPreviewGenerator constructor
const
LinkPreviewGenerator({
- Key? key,
- required String link,
- Duration cacheDuration = const Duration(days: 7),
- TextStyle? titleStyle,
- TextStyle? bodyStyle,
- LinkPreviewStyle linkPreviewStyle = LinkPreviewStyle.large,
- bool showBody = true,
- bool showDomain = true,
- bool showGraphic = true,
- bool showTitle = true,
- BoxFit graphicFit = BoxFit.cover,
- Color backgroundColor = const Color.fromRGBO(248, 248, 248, 1.0),
- int? bodyMaxLines,
- TextOverflow bodyTextOverflow = TextOverflow.ellipsis,
- void onTap()?,
- Widget? placeholderWidget,
- String? proxyUrl,
- Widget? errorWidget,
- String errorBody = 'Oops! Unable to parse the url.',
- String errorImage = 'https://raw.githubusercontent.com/ghpranav/link_preview_generator/main/assets/giphy.gif',
- String errorTitle = 'Something went wrong!',
- double borderRadius = 12.0,
- List<
BoxShadow> ? boxShadow, - bool removeElevation = false,
Creates LinkPreviewGenerator
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);