Created
August 22, 2018 08:57
-
-
Save juwencheng/56248a80d5bc2e001ef90b242e083735 to your computer and use it in GitHub Desktop.
使用Stack布局创建图文重叠的效果
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Stack( | |
children: <Widget>[ | |
new Positioned.fill( | |
child: new FadeInImage( | |
placeholder: new AssetImage('placeholder.png'), | |
image: new CachedNetworkImageProvider(photos[int].url), | |
fit: BoxFit.contain, | |
alignment: Alignment.center, | |
fadeInDuration: new Duration(milliseconds: 200), | |
fadeInCurve: Curves.linear, | |
), | |
), | |
new Positioned( | |
top: 10.0, | |
left: 10.0, | |
child: new Container( | |
child: new Text(photos[int].title) | |
), | |
), | |
], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment