Flutter基础widgets教程-FractionallySizedBox篇

简介: Flutter基础widgets教程-FractionallySizedBox篇

1 FractionallySizedBox

一个widget,它把它的子项放在可用空间的一小部分

2 构造函数

FractionallySizedBox({
    Key key,
    this.alignment = Alignment.center,
    this.widthFactor,
    this.heightFactor,
    Widget child,
})

复制

3 常用属性

3.1 alignment:对齐方式

alignment:Alignment.topLeft,

复制

3.1.1 顶部左边

alignment:Alignment.topLeft,

复制

3.1.2 顶部中间

alignment:Alignment.topCenter,

复制

3.1.3 顶部右边

alignment:Alignment.topRight,

复制

3.1.4 中部左边

alignment:Alignment.centerLeft,

复制

3.1.5 中部中间

alignment:Alignment.center,

复制

3.1.6 中部右边

alignment:Alignment.centerRight,

复制

3.1.7 底部左边

alignment:Alignment.bottomLeft,

复制

3.1.8 底部中间

alignment:Alignment.bottomCenter,

复制

3.1.9 底部右边

alignment:Alignment.bottomRight,

复制

3.2 widthFactor:FractionallySizedBox组件的宽度

widthFactor: 0.5,

复制

3.3 heightFactor:FractionallySizedBox组件的高度

heightFactor: 0.5,

复制

3.4 child:子widget

child: Text('你好 Flutter'),
相关文章
Flutter基础widgets教程-IconButton篇
Flutter基础widgets教程-IconButton篇
370 0
Flutter基础widgets教程-SizedOverflowBox篇
Flutter基础widgets教程-SizedOverflowBox篇
171 0
Flutter基础widgets教程-SizedOverflowBox篇
Flutter基础widgets教程-SizedBox篇
Flutter基础widgets教程-SizedBox篇
218 0
Flutter基础widgets教程-SizedBox篇
Flutter基础widgets教程-Offstage篇
Flutter基础widgets教程-Offstage篇
215 0
|
iOS开发
Flutter基础widgets教程-cupertinoActivityIndicator篇
Flutter基础widgets教程-cupertinoActivityIndicator篇
308 0
|
Android开发
Flutter基础widgets教程-WidgetsApp篇
Flutter基础widgets教程-WidgetsApp篇
337 0
|
Android开发
Flutter基础widgets教程-MaterialApp篇
Flutter基础widgets教程-MaterialApp篇
150 0
Flutter基础widgets教程-FractionallySizedBox篇
Flutter基础widgets教程-FractionallySizedBox篇
142 0
|
iOS开发
Flutter基础widgets教程-CupertinoAlertDialog篇
Flutter基础widgets教程-CupertinoAlertDialog篇
154 0
Flutter基础widgets教程-PopupMenuButton篇
Flutter基础widgets教程-PopupMenuButton篇
405 0