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 '../../../ArticleInfo/ArticleInfo.dart';

class Information extends StatefulWidget {
  const Information({Key? key}) : super(key: key);

  @override
  State<Information> createState() => _InformationState();
}

class _InformationState extends State<Information> {
  @override
  Widget build(BuildContext context) {
    return ListView(
      children: [
        // ListTile用不好

        GestureDetector(
          child: Container(
              padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
              width: 310.w,
              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: AssetImage('images/cars.png'),
                        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("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
                            softWrap: true,
                            maxLines: 2,
                            textAlign: TextAlign.left,
                            overflow: TextOverflow.ellipsis,
                            style: TextStyle(
                              fontSize: 17.sp,
                              fontWeight: FontWeight.bold,
                            )),
                      ),
                      Container(
                        child: Text('2022-02-09'),
                      )
                    ],
                  )
                ],
              )),
          onTap: () {
            Get.to(ArticleInfo());
          },
        ),
        GestureDetector(
          child: Container(
              padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
              width: 310.w,
              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: AssetImage('images/cars.png'),
                        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("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
                            softWrap: true,
                            maxLines: 2,
                            textAlign: TextAlign.left,
                            overflow: TextOverflow.ellipsis,
                            style: TextStyle(
                              fontSize: 17.sp,
                              fontWeight: FontWeight.bold,
                            )),
                      ),
                      Container(
                        child: Text('2022-02-09'),
                      )
                    ],
                  )
                ],
              )),
          onTap: () {
            print('进入资讯详情');
          },
        )
      ],
    );
  }
}