1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:get/get.dart';
- import 'package:get/get_core/src/get_main.dart';
-
- import '../../../../models/entities/NewsInformationModel.dart';
-
- import 'package:intl/intl.dart';
- import '../../../ArticleInfo/ArticleInfo.dart';
-
- class Information extends StatefulWidget {
- final NewsInformationModel item;
- const Information({Key? key, required this.item}) : super(key: key);
-
- @override
- State<Information> createState() => _InformationState(item);
- // getNewsList
- }
-
- class _InformationState extends State<Information> {
- final NewsInformationModel item;
-
-
- _InformationState(this.item);
-
-
- @override
- Widget build(BuildContext context) {
- return Container(
- child: Column(
- children: [
- // ListTile用不好
- GestureDetector(
- child: Container(
- padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
- decoration: const BoxDecoration(
- border: Border(
- bottom: BorderSide(width: 0.5, color: Color(0x20000000)
- // 0x17000000
- ))),
- child: Row(
- children: [
- Container(
- margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
- width: 100,
- height: 100,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: NetworkImage(item.thumb.toString()),
- fit: BoxFit.cover,
- ),
- borderRadius: BorderRadius.circular(12),
- ),
- ),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width: 240.w,
- padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
- child: Text(item.title!.toString(),
- softWrap: true,
- maxLines: 2,
- textAlign: TextAlign.left,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontSize: 17.sp,
- fontWeight: FontWeight.bold,
- )),
- ),
- Container(
- child: Text(
- item.createDate!=null? DateFormat("yyyy-MM-dd").format(DateTime.parse(item.createDate.toString())):item.createDate.toString(),),
- )
- ],
- )
- ],
- )),
- onTap: () {
- Get.to(ArticleInfo(),arguments: {'newsId':item.newsId});
- },
- ),
- ],
- ),
- );
-
-
- }
- }
|