Skip to content

Instantly share code, notes, and snippets.

@huxaiphaer
Created April 29, 2020 21:35
Show Gist options
  • Save huxaiphaer/9cb95e84c367c5239ac3b00120326fb8 to your computer and use it in GitHub Desktop.
Save huxaiphaer/9cb95e84c367c5239ac3b00120326fb8 to your computer and use it in GitHub Desktop.
Widget _detailsList(Article article, ScrollController scrollController) {
return Container(
child: ListView(
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.only(top: 00.0),
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 30.0, left: 20.0, right: 20.0, bottom: 20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
article.category.name.toUpperCase() + ' STORY',
style:
TextStyle(color: Colors.red, fontWeight: FontWeight.w700),
),
Row(
children: <Widget>[
Text(
DateFormat("d MMMM")
.format(DateTime.parse(article.created_on)),
style: TextStyle(color: Colors.black45),
),
Container(
margin: EdgeInsets.only(left: 10.0),
child: Text('2 min read',
style: TextStyle(color: Colors.black45)))
],
),
],
),
),
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, bottom: 10.0),
child: Text(
article.title,
style: TextStyle(
fontSize: 37.0,
fontWeight: FontWeight.w800,
fontFamily: 'Times'),
)),
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0),
child: Html(
data: article.summary,
)),
Container(
width: 500.0,
height: 80.0,
// color: Colors.red,
child: ListView.builder(
itemCount: article.tags.length,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return _buildTag(article.tags[index]);
}),
),
Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 30.0, top: 50.0, bottom: 50.0),
width: 60.0,
child: CircleAvatar(
radius: 30.0,
backgroundImage: NetworkImage(
'https://live.mrf.io/statics/i/ps/www.newvision.co.ug/w-images/82f1442a-b45f-4519-a50d-6143758faf85/2/cor-703x422.jpg'),
),
),
Container(
margin: EdgeInsets.only(left: 10.0, top: 50.0, bottom: 50.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 5.0),
child: Text(
article.author.first_name +
' ' +
article.author.last_name,
style: TextStyle(fontSize: 19.0),
)),
Container(
child: Row(
children: <Widget>[
Text(
'Editor ',
style: TextStyle(color: Colors.black45),
),
Text(
'@NewsVision',
style: TextStyle(
color: Colors.red[700],
fontWeight: FontWeight.bold),
)
],
),
)
],
),
),
],
),
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0),
child: Html(data: article.details),
),
Container(
margin: EdgeInsets.only(left: 20.0, top: 20.0, bottom: 20.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(right: 20.0),
child: Text(
'READ MORE',
style: TextStyle(
color: Colors.red[700],
fontSize: 18.0,
fontWeight: FontWeight.bold),
),
),
Icon(
Icons.arrow_forward_ios,
color: Colors.red[700],
size: 18.0,
)
],
),
)
],
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment