Skip to content

Instantly share code, notes, and snippets.

@wilburx9
Created April 2, 2018 13:05
Show Gist options
  • Save wilburx9/b0f185757cbacf96ab24e969239619ad to your computer and use it in GitHub Desktop.
Save wilburx9/b0f185757cbacf96ab24e969239619ad to your computer and use it in GitHub Desktop.
Widget _getPostWidgets(int index) {
var post = postList[index];
return new GestureDetector(
onTap: () {
openDetailsUI(post);
},
child: new Container(
margin: const EdgeInsets.symmetric(horizontal: 5.0, vertical: 5.0),
child: new Card(
elevation: 3.0,
child: new Row(
children: <Widget>[
new Container(
width: 150.0,
child: new Image.network(
post.thumbUrl,
fit: BoxFit.cover,
),
),
new Expanded(
child: new Container(
margin: new EdgeInsets.all(10.0),
child: new Text(
post.title,
style: new TextStyle(color: Colors.black, fontSize: 18.0),
),
)),
],
),
),
),
);
}
openDetailsUI(Post post) {
// The details UI will be opened here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment