Skip to content

Commit

Permalink
Fix an issue in some layouts with no placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
gskinner committed May 15, 2022
1 parent 300427d commit 9bdde04
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/image_fade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,17 @@ class _ImageFadeState extends State<ImageFade> with TickerProviderStateMixin {
);
}

List<Widget> kids = [];
if (widget.placeholder != null) kids.add(widget.placeholder!);
if (back != null) kids.add(back);
if (front != null) kids.add(front);

Widget content = Container(
width: widget.width,
height: widget.height,
child: Stack(
fit: StackFit.passthrough,
children: [
if (widget.placeholder != null) widget.placeholder!,
if (back != null) back,
if (front != null) front,
],
),
child: kids.isEmpty
? null
: Stack(fit: StackFit.passthrough, children: kids),
);

if (widget.excludeFromSemantics) return content;
Expand Down

0 comments on commit 9bdde04

Please sign in to comment.