Skip to content

Instantly share code, notes, and snippets.

@dllewellyn
Created December 2, 2019 14:15
Show Gist options
  • Save dllewellyn/5edf655014e1967e6a656a2d3ef69b0d to your computer and use it in GitHub Desktop.
Save dllewellyn/5edf655014e1967e6a656a2d3ef69b0d to your computer and use it in GitHub Desktop.
class TransactionListItem extends StatefulWidget {
final Transaction transaction;
const TransactionListItem({Key key, @required this.transaction})
: super(key: key);
@override
_TransactionListItemState createState() => _TransactionListItemState();
}
class _TransactionListItemState extends State<TransactionListItem> {
@override
Widget build(BuildContext context) {
return Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: <Widget>[
Text(
widget.transaction.date,
style: Theme.of(context).textTheme.body1
),
Spacer(),
Text(
widget.transaction.amount,
style: Theme.of(context).textTheme.caption,
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment