index.dart 4.8KB

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