Skip to content

Instantly share code, notes, and snippets.

@webkong
Last active November 22, 2019 03:42
Show Gist options
  • Save webkong/464f06747d4eb83ba7790c917e487b32 to your computer and use it in GitHub Desktop.
Save webkong/464f06747d4eb83ba7790c917e487b32 to your computer and use it in GitHub Desktop.
[Flutter widget] #Flutter
ListTile(
leading: Image.network(memorabiliaList[index].photo),
title: Text(
memorabiliaList[index].title,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
subtitle: Text(
memorabiliaList[index].description,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
new ListView.builder(
itemCount: memorabiliaList.length,
itemBuilder: (BuildContext context, int index) {
return new Stack(
children: <Widget>[
new Padding(
padding: const EdgeInsets.only(left: 45.0),
child: new Card(
margin: new EdgeInsets.all(5.0),
child: new Container(
width: double.infinity,
height: 80.0,
child: Center(
child: ListTile(
leading: Image.network(memorabiliaList[index].photo),
title: Text(
memorabiliaList[index].title,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
subtitle: Text(
memorabiliaList[index].description,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
),
),
),
),
new Positioned(
top: 3.0,
bottom: 0.0,
left: 0.0,
child: Column(
children: <Widget>[
Text(
Tools.formatDate(memorabiliaList[index].date, format: 'yyyy'),
style: TextStyle(
fontSize: 10,
),
),
Text(
Tools.formatDate(memorabiliaList[index].date, format: 'MM'),
style: TextStyle(
fontSize: 10,
),
),
],
),
),
new Positioned(
top: 0.0,
bottom: 0.0,
left: 25.0,
child: new Container(
height: double.infinity,
width: 1.0,
color: Theme.of(context).accentColor,
),
),
new Positioned(
top: 30.0,
left: 7.0,
child: new Container(
height: 36.0,
width: 36.0,
decoration: new BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
),
child: new Container(
margin: new EdgeInsets.all(5.0),
height: 30.0,
width: 30.0,
decoration: new BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).accentColor,
),
child: Center(
child: Text(Tools.formatDate(memorabiliaList[index].date, format: 'dd')),
),
),
),
)
],
);
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment