index.dart 4.4KB

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