Flutter Widget之Column

Widget:https://flutter.io/docs/development/ui/widgets
Column:https://docs.flutter.io/flutter/widgets/Column-class.html

import 'package:flutter/material.dart';

class ColumnDemoPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => new _ColumnDemoPageState();
}

class _ColumnDemoPageState extends State<ColumnDemoPage> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(title: new Text('Column Page Demo'),),
      body: Center(
//          child: Column(
//            children: <Widget>[
//              Text('Deliver features faster'),
//              Text('Craft beautiful UIs'),
//              Expanded(
//                child: FittedBox(
//                  fit: BoxFit.contain, // otherwise the logo will be tiny
//                  child: const FlutterLogo(),
//                ),
//              ),
//            ],
//          )
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          Text('We move under cover and we move as one'),
          Text('Through the night, we have one shot to live another day'),
          Text('We cannot let a stray gunshot give us away'),
          Text('We will fight up close, seize the moment and stay in it'),
          Text('It\'s either that or meet the business end of a bayonet'),
          Text('The code word is \'Rochambeau\', dig me?'),
          Text('Rochambeau!', style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 2.0)),
        ],
      ),
      ),
    );
  }
}

Flutter Widget Column

上一篇 Flutter Widget之Row
下一篇 Flutter Widget之Text
目录
文章列表
1 分布式Snowflake雪花算法
分布式Snowflake雪花算法
2
Android 10(Api 29)新特性适配 - 后台应用增加定位限制
Android 10(Api 29)新特性适配 - 后台应用增加定位限制
3
使用MyBatis查询数据,按特定顺序排序
使用MyBatis查询数据,按特定顺序排序
4
Swift UI - 工具条(UIToolbar)及工具条按钮(UIBarButtonItem)
Swift UI - 工具条(UIToolbar)及工具条按钮(UIBarButtonItem)
5
Dart创建工厂模式
Dart创建工厂模式
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。