I need an icon that will dynamically stretch to fill the parent container.
I don't think this is possible directly on the Icon (since it only has a size property), but is there another solution I'm overlooking?
I believe you can use FittedBox
with Expanded
:
new Expanded(
child: new FittedBox(
fit: BoxFit.fill,
child: new Icon(Icons.home),
),
),
Please note the in the docs that Expanded
has to be wrapped in a Column
, Row
or Flex
widget.
References:
Expanded
FittedBox
BoxFit
https://groups.google.com/forum/#!msg/flutter-dev/lsgdU1yl7xc/0pYS2qrzBQAJ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With