美文网首页
flutter控件之Table

flutter控件之Table

作者: Mr丶xi先森 | 来源:发表于2018-09-11 16:17 被阅读397次
import 'package:flutter/material.dart';
class LearnTable extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    return new  _LearnTable();
  }
}
class _LearnTable extends State<LearnTable>{
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Table(
        border: new TableBorder.all(width: 1.0,color: Colors.purpleAccent),
        children: <TableRow>[
          new TableRow(
            children: <Widget>[
              new TableCell(
                child: new Center(
                  child: new Text('设置1'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置2'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置3'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置4'),
               ),
              ),
            ],
          ),
          new TableRow(
            children: <Widget>[
              new TableCell(
                child: new Center(
                  child: new Text('设置1'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置2'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置3'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置4'),
                ),
              ),
            ],
          ),
          new TableRow(
            children: <Widget>[
              new TableCell(
                child: new Center(
                  child: new Text('设置1'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置2'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置3'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置4'),
                ),
              ),
            ],
          ),
          new TableRow(
            children: <Widget>[
              new TableCell(
                child: new Center(
                  child: new Text('设置1'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置2'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置3'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置4'),
                ),
              ),
            ],
          ),
          new TableRow(
            children: <Widget>[
              new TableCell(
                child: new Center(
                  child: new Text('设置1'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置2'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置3'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置4'),
                ),
              ),
            ],
          ),
          new TableRow(
            children: <Widget>[
              new TableCell(
                child: new Center(
                  child: new Text('设置1'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置2'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置3'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置4'),
                ),
              ),
            ],
          ),
          new TableRow(
            children: <Widget>[
              new TableCell(
                child: new Center(
                  child: new Text('设置1'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置2'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置3'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置4'),
                ),
              ),
            ],
          ),
          new TableRow(
            children: <Widget>[
              new TableCell(
                child: new Center(
                  child: new Text('设置1'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置2'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置3'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置4'),
                ),
              ),
            ],
          ),
          new TableRow(
            children: <Widget>[
              new TableCell(
                child: new Center(
                  child: new Text('设置1'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置2'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置3'),
                ),
              ),
              new TableCell(
                child: new Center(
                  child: new Text('设置4'),
                ),
              ),
            ],
          ),
        ],
      ),
    );
  }
}

相关文章

网友评论

      本文标题:flutter控件之Table

      本文链接:https://www.haomeiwen.com/subject/cymugftx.html