背景
用于展示表格组件,可指定线宽、列宽、文字方向等属性
属性 | 作用 |
---|---|
columnWidths | 列的宽度 |
defaultVerticalAlignment | 网格内部组件摆放方向 |
border | 网格样式修改 |
children | 表格里面的组件 |
textDirection | 文本排序方向 |
import 'package:flutter/material.dart';
class CustomTable extends StatelessWidget {
const CustomTable({
Key? key}) : super(key: key);
Widget build(BuildContext context) {
_ItemBean title = _ItemBean("姓名", "年龄", "性别", "单位名称", "单位地点");
_ItemBean m = _ItemBean("周", "20", "男", "得意", "武汉");
_ItemBean kg = _ItemBean("王", "18", "男", "中科", "武汉");
_ItemBean s = _ItemBean("李", "