Browse Source

文章更改

dart3_last
wurong 2 years ago
parent
commit
04fbb48829
  1. 47
      lib/community/headlines/article_list.dart

47
lib/community/headlines/article_list.dart

@ -81,8 +81,8 @@ class _ArticleList extends State<ArticleList> {
Widget articleItem(Article articles, position) {
return Container(
width: double.infinity,
padding: EdgeInsets.all(16),
margin: EdgeInsets.only(bottom: 12.h),
padding: EdgeInsets.all(8),
margin: EdgeInsets.only(bottom: 16.h),
color: Colors.white,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
@ -90,7 +90,7 @@ class _ArticleList extends State<ArticleList> {
children: [
Expanded(
child: Container(
height: MediaQuery.of(context).size.width >= 650 ? 133.h :105,
height: MediaQuery.of(context).size.width >= 650 ? 133.h :100.h,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
@ -106,11 +106,11 @@ class _ArticleList extends State<ArticleList> {
color: Colors.black,
),
),
SizedBox(height:6.h),
SizedBox(height:8.h),
Expanded(child: Text(
widget?.articles[position]?.viceTitle ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
height: 1.2.h,
@ -122,27 +122,28 @@ class _ArticleList extends State<ArticleList> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
widget.articles != null
? widget.articles[position]?.author?.name ?? ""
: "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF8E8E8E),
),
),
),
SizedBox(width: 8.w),
// Expanded(
// child: Text(
// widget.articles != null
// ? widget.articles[position]?.author?.name ?? ""
// : "",
// overflow: TextOverflow.ellipsis,
// maxLines: 1,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.medium,
// color: Color(0xFF8E8E8E),
// ),
// ),
// ),
// SizedBox(width: 8.w),
Image.asset(
"assets/image/browse.webp",
width: 14,
height: 14,
color: Color(0xFF808080),
),
SizedBox(width: 6.w,),
Expanded(
child: Text(
"${widget?.articles[position]?.viewers}" ?? "",
@ -152,7 +153,7 @@ class _ArticleList extends State<ArticleList> {
color: Color(0xFF8D8D8D),
),
)),
Text(
Expanded(child:Text(
widget?.articles[position]?.createTime?.split(" ")[0] ??
"",
style: TextStyle(
@ -160,7 +161,9 @@ class _ArticleList extends State<ArticleList> {
fontWeight: MyFontWeight.regular,
color: Color(0xFF8D8D8D),
),
),
)),
Spacer()
],
)
],

Loading…
Cancel
Save