import 'package:flutter/material.dart';

class FeedbackRecordItem extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 4, bottom: 4),
      padding: EdgeInsets.all(15),
      width: double.infinity,
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(7.5),
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Expanded(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                _createTitle(),
                _createDesc(),
                _createImage(),
                _createTime(),
              ],
            ),
          ),
          Container(
            width: 60,
            height: 60,
            decoration: BoxDecoration(
              color: Colors.green,
              borderRadius: BorderRadius.circular(30),
            ),
          )
        ],
      ),
    );
  }

  Widget _createTitle() {
    List<InlineSpan> list = List();

    list.add(WidgetSpan(
      child: Container(
        padding: EdgeInsets.only(left: 2, right: 2, top: 3, bottom: 3),
        margin: EdgeInsets.only(right: 4),
        child: Text(
          '功能异常',
          style: TextStyle(
            fontSize: 9,
            height: 1,
            // color: HexColor.fromHex(style.providerNameColor),
            color: Colors.white,
          ),
        ),
        decoration: BoxDecoration(
            color: Colors.redAccent, borderRadius: BorderRadius.circular(2.5)),
      ),
    ));

    list.add(TextSpan(
      text: '关于关闭提现功能的反馈',
      style: TextStyle(
          fontSize: 14, color: Color(0xff333333), fontWeight: FontWeight.bold),
    ));
    return RichText(
      maxLines: 2,
      overflow: TextOverflow.ellipsis,
      text: TextSpan(children: list),
    );
  }

  Widget _createDesc() {
    return Container(
      child: Text(
        '我今天想使用我的提现功能的时候，发现官方已经把这个功能给暂时关闭了，所以我很伤心，不开心不开心不开心，所以我很伤心，不开心不开心不开心',
        style: TextStyle(fontSize: 11, color: Color(0xff999999)),
      ),
    );
  }

  Widget _createImage() {
    return Container(
      margin: EdgeInsets.only(top: 4, bottom: 4),
      child: Wrap(
        children: <Widget>[
          Container(
            width: 60,
            height: 60,
            color: Colors.redAccent,
          ),
        ],
      ),
    );
  }

  Widget _createTime() {
    return Container(
      child: Text(
        '2020-06-23 01:00:06',
        style: TextStyle(fontSize: 11, color: Color(0xffd8d8d8)),
      ),
    );
  }
}
