index.dart 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:get/get.dart';
  4. import 'package:get/get_core/src/get_main.dart';
  5. import '../../../ArticleInfo/ArticleInfo.dart';
  6. class Information extends StatefulWidget {
  7. const Information({Key? key}) : super(key: key);
  8. @override
  9. State<Information> createState() => _InformationState();
  10. }
  11. class _InformationState extends State<Information> {
  12. @override
  13. Widget build(BuildContext context) {
  14. return ListView(
  15. children: [
  16. // ListTile用不好
  17. GestureDetector(
  18. child: Container(
  19. padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
  20. width: 310.w,
  21. decoration: const BoxDecoration(
  22. border: Border(
  23. bottom: BorderSide(width: 0.5, color: Color(0x20000000)
  24. // 0x17000000
  25. ))),
  26. child: Row(
  27. children: [
  28. Container(
  29. margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
  30. width: 100,
  31. height: 100,
  32. decoration: BoxDecoration(
  33. image: DecorationImage(
  34. image: AssetImage('images/cars.png'),
  35. fit: BoxFit.cover,
  36. ),
  37. borderRadius: BorderRadius.circular(12),
  38. ),
  39. ),
  40. Column(
  41. crossAxisAlignment: CrossAxisAlignment.start,
  42. children: [
  43. Container(
  44. width: 240.w,
  45. padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
  46. child: Text("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
  47. softWrap: true,
  48. maxLines: 2,
  49. textAlign: TextAlign.left,
  50. overflow: TextOverflow.ellipsis,
  51. style: TextStyle(
  52. fontSize: 17.sp,
  53. fontWeight: FontWeight.bold,
  54. )),
  55. ),
  56. Container(
  57. child: Text('2022-02-09'),
  58. )
  59. ],
  60. )
  61. ],
  62. )),
  63. onTap: () {
  64. Get.to(ArticleInfo());
  65. },
  66. ),
  67. GestureDetector(
  68. child: Container(
  69. padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
  70. width: 310.w,
  71. decoration: const BoxDecoration(
  72. border: Border(
  73. bottom: BorderSide(width: 0.5, color: Color(0x20000000)
  74. // 0x17000000
  75. ))),
  76. child: Row(
  77. children: [
  78. Container(
  79. margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
  80. width: 100,
  81. height: 100,
  82. decoration: BoxDecoration(
  83. image: DecorationImage(
  84. image: AssetImage('images/cars.png'),
  85. fit: BoxFit.cover,
  86. ),
  87. borderRadius: BorderRadius.circular(12),
  88. ),
  89. ),
  90. Column(
  91. crossAxisAlignment: CrossAxisAlignment.start,
  92. children: [
  93. Container(
  94. width: 240.w,
  95. padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
  96. child: Text("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
  97. softWrap: true,
  98. maxLines: 2,
  99. textAlign: TextAlign.left,
  100. overflow: TextOverflow.ellipsis,
  101. style: TextStyle(
  102. fontSize: 17.sp,
  103. fontWeight: FontWeight.bold,
  104. )),
  105. ),
  106. Container(
  107. child: Text('2022-02-09'),
  108. )
  109. ],
  110. )
  111. ],
  112. )),
  113. onTap: () {
  114. print('进入资讯详情');
  115. },
  116. )
  117. ],
  118. );
  119. }
  120. }