| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- import 'package:cached_network_image/cached_network_image.dart';
- import 'package:flutter/material.dart';
- import 'package:jmrh/constant/styles.dart';
- class ItemPost extends StatefulWidget {
- ItemPost({Key key}) : super(key: key);
- @override
- _ItemPostState createState() => _ItemPostState();
- }
- class _ItemPostState extends State<ItemPost> {
- @override
- Widget build(BuildContext context) {
- return InkWell(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- Container(
- padding: EdgeInsets.all(16),
- child: Row(
- children: [
- ClipOval(
- child: CachedNetworkImage(
- imageUrl: 'https://zhumj.oss-cn-hangzhou.aliyuncs.com/image/user.jpg',
- width: 26,
- height: 26,
- ),
- ),
- Expanded(
- child: Container(
- padding: EdgeInsets.symmetric(horizontal: 10),
- child: Text(
- '夏秋雨',
- style: TextStyle(fontSize: 14, color: Colors.black),
- overflow: TextOverflow.ellipsis,
- ),
- ),
- ),
- Text(
- '05-23',
- style: TextStyle(color: COLOR_TEXT_2, fontSize: 13),
- )
- ],
- ),
- ),
- Container(
- padding: EdgeInsets.symmetric(horizontal: 16),
- child: RichText(
- text: TextSpan(children: [
- WidgetSpan(
- alignment: PlaceholderAlignment.baseline,
- baseline: TextBaseline.alphabetic,
- child: Container(
- decoration: BoxDecoration(
- color: COLOR_PRIMARY,
- borderRadius: BorderRadius.all(Radius.circular(2)),
- ),
- padding: EdgeInsets.symmetric(horizontal: 4, vertical: 1),
- margin: EdgeInsets.only(right: 4),
- child: Text(
- '热议',
- style: TextStyle(color: Colors.white, fontSize: 11, height: 1.8),
- ),
- ),
- ),
- TextSpan(
- text: '自来水总是有一股消毒水味道,政府加大水质监管措施的几点建议',
- style: TextStyle(color: COLOR_TEXT_1, fontSize: 14, fontWeight: FontWeight.bold, height: 1.8))
- ]),
- ),
- ),
- Container(
- height: 46,
- child: Row(
- children: [
- Expanded(
- child: Row(children: [
- Image.asset('img/icon_redu.png'),
- Container(
- margin: EdgeInsets.only(left: 4),
- child: Text(
- '26461',
- style: TextStyle(color: COLOR_TEXT_3, fontSize: 13),
- ),
- )
- ], mainAxisAlignment: MainAxisAlignment.center),
- ),
- Expanded(
- child: Row(children: [
- Image.asset('img/icon_pingjia.png'),
- Container(
- margin: EdgeInsets.only(left: 4),
- child: Text(
- '3644',
- style: TextStyle(color: COLOR_TEXT_3, fontSize: 13),
- ),
- )
- ], mainAxisAlignment: MainAxisAlignment.center),
- ),
- Expanded(
- child: Row(children: [
- Image.asset('img/icon_dianzhan.png'),
- Container(
- margin: EdgeInsets.only(left: 4),
- child: Text(
- '11243',
- style: TextStyle(color: COLOR_TEXT_3, fontSize: 13),
- ),
- )
- ], mainAxisAlignment: MainAxisAlignment.center),
- )
- ],
- ),
- ),
- ],
- ),
- onTap: () {
- Navigator.of(context).pushNamed('/postDetail');
- },
- );
- }
- }
|