You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue with the code provided in the example below. When I copied the whole code from the interactive editor in the website and pasted it into my project to use the ShimmerLoading widget, I found that I get the classic Null check operator used on a null value error. See the issue in the below snippet.
// Collect ancestor shimmer information.final shimmer =Shimmer.of(context)!; /// Error comes from this lineif (!shimmer.isSized) {
// The ancestor Shimmer widget isn't laid// out yet. Return an empty box.returnconstSizedBox();
}
Expected fix
It should be changed to this,
// Collect ancestor shimmer info.final shimmer =Shimmer.of(context);
if (shimmer ==null||!shimmer.isSized) {
// The ancestor Shimmer widget has not laid// itself out yet. Return an empty box.returnconstSizedBox();
}
Additional context
No response
I would like to fix this problem.
I will try and fix this problem on docs.flutter.dev.
The text was updated successfully, but these errors were encountered:
Page URL
https://docs.flutter.dev/cookbook/effects/shimmer-loading/
Page source
https://github.com/flutter/website/tree/main/src/content/cookbook/effects/shimmer-loading.md
Describe the problem
There is an issue with the code provided in the example below. When I copied the whole code from the interactive editor in the website and pasted it into my project to use the
ShimmerLoading
widget, I found that I get the classicNull check operator used on a null value
error. See the issue in the below snippet.Expected fix
It should be changed to this,
Additional context
No response
I would like to fix this problem.
The text was updated successfully, but these errors were encountered: