Skip to content

Commit

Permalink
Add date in news
Browse files Browse the repository at this point in the history
Co-authored-by: Simone Sestito <[email protected]>
  • Loading branch information
m-i-n-a-r and Simone Sestito committed Oct 21, 2018
1 parent 2df4ded commit a7b63d1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/view/NewsView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,23 @@ class NewsItem extends StatelessWidget {
padding: EdgeInsets.all(11.0),
child: Text(news.preview, style: TextStyle(color: Colors.black)),
),
Padding(
padding: EdgeInsets.only(bottom: 8.0, right: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Icon(Icons.calendar_today, color: Colors.black),
Padding(padding: EdgeInsets.all(2.5)),
Text(_dateToCalendarString(news.date), style: TextStyle(color: Colors.black)),
]),
),
],
),
),
onTap: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => SingleNewsRoute(news: news))),
);
}

String _dateToCalendarString(DateTime date) => "${date.month}/${date.day}/${date.year}";
}

0 comments on commit a7b63d1

Please sign in to comment.