I am trying to add a Stack within a ListView in a SafeArea. However, there is a runtime exception as seen below:
BoxConstraints forces an infinite height.
I/flutter (18717): These invalid constraints were provided to RenderConstrainedBox's layout() function by the following
I/flutter (18717): function, which probably computed the invalid constraints in question:
I/flutter (18717): RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:259:13)
I/flutter (18717): The offending constraints were:
I/flutter (18717): BoxConstraints(w=411.4, h=Infinity)
My code:
@override
Widget build(BuildContext context) {
SizeConfig().init(context);
return new Scaffold(
body: SafeArea(
top: true,
child: ListView( shrinkWrap: true,
children: <Widget>[_buildFrostedRow(context)])));
}
Stack _buildFrostedRow(BuildContext context) {
return Stack(
children: <Widget>[
new ConstrainedBox(
constraints: const BoxConstraints.expand(), child: _showCardRow()),
new Center(
child: new ClipRect(
child: new BackdropFilter(
filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: new Container(
width: SizeConfig.safeBlockHorizontal * 90,
height: SizeConfig.safeBlockVertical * 20,
decoration: new BoxDecoration(
color: Colors.grey.shade200.withOpacity(0.5)),
child: new Center(
child: new Text('Frosted',
style: Theme.of(context).textTheme.display3),
),
),
),
),
),
],
);
}
What am I missing here?