index.dart 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 '../../../../models/entities/NewsInformationModel.dart';
  6. import 'package:intl/intl.dart';
  7. import '../../../ArticleInfo/ArticleInfo.dart';
  8. class Information extends StatefulWidget {
  9. final NewsInformationModel item;
  10. const Information({Key? key, required this.item}) : super(key: key);
  11. @override
  12. State<Information> createState() => _InformationState();
  13. // getNewsList
  14. }
  15. class _InformationState extends State<Information> {
  16. late final NewsInformationModel item;
  17. @override
  18. Widget build(BuildContext context) {
  19. return Column(
  20. children: [
  21. // ListTile用不好
  22. GestureDetector(
  23. child: Container(
  24. padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
  25. decoration: const BoxDecoration(
  26. border: Border(
  27. bottom: BorderSide(width: 0.5, color: Color(0x20000000)
  28. // 0x17000000
  29. ))),
  30. child: Row(
  31. children: [
  32. Container(
  33. margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
  34. width: 100,
  35. height: 100,
  36. decoration: BoxDecoration(
  37. image: DecorationImage(
  38. image: AssetImage('images/cars.png'),
  39. fit: BoxFit.cover,
  40. ),
  41. borderRadius: BorderRadius.circular(12),
  42. ),
  43. ),
  44. Column(
  45. crossAxisAlignment: CrossAxisAlignment.start,
  46. children: [
  47. Container(
  48. width: 240.w,
  49. padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
  50. child: Text('',
  51. softWrap: true,
  52. maxLines: 2,
  53. textAlign: TextAlign.left,
  54. overflow: TextOverflow.ellipsis,
  55. style: TextStyle(
  56. fontSize: 17.sp,
  57. fontWeight: FontWeight.bold,
  58. )),
  59. ),
  60. Container(
  61. child: Text(''),
  62. )
  63. ],
  64. )
  65. ],
  66. )),
  67. onTap: () {
  68. Get.to(ArticleInfo());
  69. },
  70. ),
  71. ],
  72. );
  73. }
  74. }