Skip to content

Instantly share code, notes, and snippets.

@juwencheng
Created August 22, 2018 08:56
Show Gist options
  • Save juwencheng/3c771431ee76e96bb6f73c3cfe29cf5c to your computer and use it in GitHub Desktop.
Save juwencheng/3c771431ee76e96bb6f73c3cfe29cf5c to your computer and use it in GitHub Desktop.

Revisions

  1. @OwenJu OwenJu created this gist Aug 22, 2018.
    21 changes: 21 additions & 0 deletions image_and_text_in_stack.dart
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    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)
    ),
    ),
    ],
    )