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

Loading…
Cancel
Save