Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kishan-dhankecha authored Dec 26, 2024
1 parent 01b001d commit 0c26633
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ class _ShimmerLoadingState extends State<ShimmerLoading> {
}

// Collect ancestor shimmer info.
final shimmer = Shimmer.of(context)!;
if (!shimmer.isSized) {
final shimmer = Shimmer.of(context);
if (shimmer == null || !shimmer.isSized) {
// The ancestor Shimmer widget has not laid
// itself out yet. Return an empty box.
return const SizedBox();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class _ShimmerLoadingState extends State<ShimmerLoading> {
}

// Collect ancestor shimmer information.
final shimmer = Shimmer.of(context)!;
if (!shimmer.isSized) {
final shimmer = Shimmer.of(context);
if (shimmer == null || !shimmer.isSized) {
// The ancestor Shimmer widget isn't laid
// out yet. Return an empty box.
return const SizedBox();
Expand Down
14 changes: 7 additions & 7 deletions src/content/cookbook/effects/shimmer-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,11 @@ class _ShimmerLoadingState extends State<ShimmerLoading> {
return widget.child;
}
// Collect ancestor shimmer information.
final shimmer = Shimmer.of(context)!;
if (!shimmer.isSized) {
// The ancestor Shimmer widget isn't laid
// out yet. Return an empty box.
// 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.
return const SizedBox();
}
final shimmerSize = shimmer.size;
Expand Down Expand Up @@ -815,8 +815,8 @@ class _ShimmerLoadingState extends State<ShimmerLoading> {
}
// Collect ancestor shimmer info.
final shimmer = Shimmer.of(context)!;
if (!shimmer.isSized) {
final shimmer = Shimmer.of(context);
if (shimmer == null || !shimmer.isSized) {
// The ancestor Shimmer widget has not laid
// itself out yet. Return an empty box.
return const SizedBox();
Expand Down

0 comments on commit 0c26633

Please sign in to comment.