1. Widget td(int flex, {String title = '', bool isLabel = false, bool isLeft = false, bool isBottom = false, bool isCustom = false, Widget customContent}) {
    2. return Expanded(
    3. flex: flex,
    4. child: Container(
    5. padding: EdgeInsets.symmetric(vertical: setSize(10), horizontal: setSize(5)),
    6. decoration: BoxDecoration(
    7. border: Border(
    8. top: BorderSide(width: setSize(1), color: Color(0xffeaeaea)),
    9. right: BorderSide(width: setSize(1), color: Color(0xffeaeaea)),
    10. left: isLeft ? BorderSide(width: setSize(1), color: Color(0xffeaeaea)) : BorderSide.none,
    11. bottom: isBottom ? BorderSide(width: setSize(1), color: Color(0xffeaeaea)) : BorderSide.none,
    12. )
    13. ),
    14. alignment: Alignment.center,
    15. child: !isCustom ? Text(title, style: TextStyle(fontSize: setFont(14), color: Color(isLabel ? 0xff62AAFF : 0xff333333), fontWeight: FontWeight.w600),) : customContent,
    16. ),
    17. );
    18. }
    19. // IntrinsicHeight 是关键, 这里模拟table使用场景
    20. IntrinsicHeight(
    21. child: Row(
    22. mainAxisAlignment: MainAxisAlignment.start,
    23. crossAxisAlignment: CrossAxisAlignment.start,
    24. children: <Widget>[
    25. td(1, title: '姓名', isLabel: true, isLeft: true),
    26. td(1, title: ''),
    27. td(1, title: '姓别', isLabel: true),
    28. td(1, title: ''),
    29. td(1, title: '性格', isLabel: true),
    30. td(1, title: ''),
    31. td(1, title: '出生年月', isLabel: true),
    32. td(1, title: ''),
    33. td(1, title: '电话', isLabel: true),
    34. td(1, title: ''),
    35. ],
    36. ),
    37. ),