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
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