From 04fbb4882902dbfaca8a8177a95dccfaa896e86f Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 19 Oct 2022 19:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/headlines/article_list.dart | 47 ++++++++++++----------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/lib/community/headlines/article_list.dart b/lib/community/headlines/article_list.dart index b87f3c8c..60381c7c 100644 --- a/lib/community/headlines/article_list.dart +++ b/lib/community/headlines/article_list.dart @@ -81,8 +81,8 @@ class _ArticleList extends State { 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 { 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 { 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 { 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 { color: Color(0xFF8D8D8D), ), )), - Text( + Expanded(child:Text( widget?.articles[position]?.createTime?.split(" ")[0] ?? "", style: TextStyle( @@ -160,7 +161,9 @@ class _ArticleList extends State { fontWeight: MyFontWeight.regular, color: Color(0xFF8D8D8D), ), - ), + )), + Spacer() + ], ) ],