ProjectDetailsItemView.dart 1.54 KB
Newer Older
朱翠翠's avatar
朱翠翠 committed
1 2 3 4 5
/*
 * @author zcc
 * @date   2020-07-01
 * 项目说明
 **/
朱翠翠's avatar
朱翠翠 committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:gm_flutter/ClueModel/server/entity/ProjectDetailsItem.dart';

class ProjectDetailsItemView extends StatelessWidget {
  Groups listData;

  ProjectDetailsItemView(this.listData);

  @override
  Widget build(BuildContext context) {
    List<Widget> tiles = [];
    for (var item in listData.attrs) {
      tiles.add(getItem(item));
    }
    var row = Row(
      children: <Widget>[
        Container(
          padding: EdgeInsets.only(top: 8.0, bottom: 8.0, left: 20),
          child: Text(
            listData.name,
            style: TextStyle(
              color: Color(0xFF000000),
              fontSize: 15.0,
            ),
          ),
        ),
        Column(
          children: tiles,
        )
      ],
    );
    return Container(
      margin: EdgeInsets.only(bottom: 5, left: 20),
      child: row,
    );
  }

  getItem(Attrs attrs) {
    var row = Container(
      margin: EdgeInsets.only(bottom: 25),
      child: Row(
        children: <Widget>[
          Text(
朱翠翠's avatar
朱翠翠 committed
50
            attrs.attrName,
朱翠翠's avatar
朱翠翠 committed
51 52 53 54 55 56
            style: TextStyle(
              color: Color(0xFF999999),
              fontSize: 13.0,
            ),
          ),
          Text(
朱翠翠's avatar
朱翠翠 committed
57
            attrs.attrValue,
朱翠翠's avatar
朱翠翠 committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71
            style: TextStyle(
              color: Color(0xFF282828),
              fontSize: 14.0,
            ),
            maxLines: 1,
          ),
        ],
      ),
    );
    return Container(
      child: row,
    );
  }
}