Stack Overflow Asked by gsk on December 2, 2020
I am trying to make an app bar looks like this:
I hope to collapse the big image using SilverAppBar
, but I am having hard time to insert AssetImage
(or Image.asset'). I almost exactly followed the code from the [official Flutter website][2], and unfortunately, both
AssetImageand
Image.asset` cannot be used as shown below:
Is there any way to do this?
maybe you can use background like this:
SliverAppBar(
...
...
background: Image(
image: NetworkImage(recipeDetails.coverPhoto),
fit: BoxFit.cover,
),
),
Answered by xion on December 2, 2020
Wrap Image.asset with Container widget
Stack(
fit: StackFit.expand,
children: <Widget>[
Container(
child: Image.asset('name'),
)
],
),
Answered by Titas Černiauskas on December 2, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP