LinearGradient shimmerGradient = LinearGradient(
colors: [
Color(0xFFEBEBF4),
Color(0xFFF4F4F4),
Color(0xFFEBEBF4),
],
stops: [
0.1,
0.3,
0.4,
],
begin: Alignment(-1.0, -0.3),
end: Alignment(1.0, 0.3),
tileMode: TileMode.clamp,
);
return CachedNetworkImage(
imageUrl: widget.imageUrl,
placeholder: (context, url) {
return ShimmerLoading(
isLoading: true,
child: Container(
decoration: const BoxDecoration(
color: Colors.white,
),
));
},
);
if (!widget.isLoading) {
return widget.child;
}
// Вот здесь выскакивает ошибка.
final offsetWithinShimmer = shimmer.getDescendantOffset(
descendant: context.findRenderObject() as RenderBox,
);
if (!widget.isLoading
|| context.findRenderObject() == null
|| Shimmer.of(context) == null) {
return widget.child;
}