fixed image exception.

This commit is contained in:
Livinglist
2022-01-08 19:33:22 -08:00
parent 0d259868e7
commit 8bd86f86fe

View File

@ -148,21 +148,21 @@ class _LinkPreviewState extends State<LinkPreview> {
} }
} }
Widget _buildPlaceHolder(Color color, double defaultHeight) { // Widget _buildPlaceHolder(Color color, double defaultHeight) {
return SizedBox( // return SizedBox(
height: defaultHeight, // height: defaultHeight,
child: LayoutBuilder(builder: (context, constraints) { // child: LayoutBuilder(builder: (context, constraints) {
final layoutWidth = constraints.biggest.width; // final layoutWidth = constraints.biggest.width;
final layoutHeight = constraints.biggest.height; // final layoutHeight = constraints.biggest.height;
//
return Container( // return Container(
color: color, // color: color,
width: layoutWidth, // width: layoutWidth,
height: layoutHeight, // height: layoutHeight,
); // );
}), // }),
); // );
} // }
Widget _buildLinkContainer( Widget _buildLinkContainer(
double _height, { double _height, {
@ -228,8 +228,11 @@ class _LinkPreviewState extends State<LinkPreview> {
); );
} else { } else {
loadedWidget = _info == null loadedWidget = _info == null
? widget.errorWidget ?? ? _buildLinkContainer(
_buildPlaceHolder(widget.backgroundColor!, _height) _height,
title: _errorTitle,
image: _errorImage,
)
: _buildLinkContainer(_height, : _buildLinkContainer(_height,
title: _errorTitle, title: _errorTitle,
desc: WebAnalyzer.isNotEmpty(info!.description) desc: WebAnalyzer.isNotEmpty(info!.description)