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. 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 Column(
  15. children: [
  16. // ListTile用不好
  17. GestureDetector(
  18. child: Container(
  19. padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
  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.to(ArticleInfo());
  64. },
  65. ),
  66. GestureDetector(
  67. child: Container(
  68. padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
  69. decoration: const BoxDecoration(
  70. border: Border(
  71. bottom: BorderSide(width: 0.5, color: Color(0x20000000)
  72. // 0x17000000
  73. ))),
  74. child: Row(
  75. children: [
  76. Container(
  77. margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
  78. width: 100,
  79. height: 100,
  80. decoration: BoxDecoration(
  81. image: DecorationImage(
  82. image: AssetImage('images/cars.png'),
  83. fit: BoxFit.cover,
  84. ),
  85. borderRadius: BorderRadius.circular(12),
  86. ),
  87. ),
  88. Column(
  89. crossAxisAlignment: CrossAxisAlignment.start,
  90. children: [
  91. Container(
  92. width: 240.w,
  93. padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
  94. child: Text("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
  95. softWrap: true,
  96. maxLines: 2,
  97. textAlign: TextAlign.left,
  98. overflow: TextOverflow.ellipsis,
  99. style: TextStyle(
  100. fontSize: 17.sp,
  101. fontWeight: FontWeight.bold,
  102. )),
  103. ),
  104. Container(
  105. child: Text('2022-02-09'),
  106. )
  107. ],
  108. )
  109. ],
  110. )),
  111. onTap: () {
  112. print('进入资讯详情');
  113. },
  114. )
  115. ],
  116. );
  117. }
  118. }