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篇
380 0
Flutter基础widgets教程-SizedOverflowBox篇
Flutter基础widgets教程-SizedOverflowBox篇
175 0
Flutter基础widgets教程-SizedOverflowBox篇
Flutter基础widgets教程-SizedBox篇
Flutter基础widgets教程-SizedBox篇
222 0
Flutter基础widgets教程-SizedBox篇
|
容器
Flutter基础widgets教程-FittedBox篇
Flutter基础widgets教程-FittedBox篇
172 0
Flutter基础widgets教程-LinearProgressIndicator篇
Flutter基础widgets教程-LinearProgressIndicator篇
228 0
Flutter基础widgets教程-IntrinsicHeight篇
Flutter基础widgets教程-IntrinsicHeight篇
360 0
Flutter基础widgets教程-FractionallySizedBox篇
Flutter基础widgets教程-FractionallySizedBox篇
145 0
|
Android开发
Flutter基础widgets教程-MaterialApp篇
Flutter基础widgets教程-MaterialApp篇
159 0
Flutter基础widgets教程-ButtonBar篇
Flutter基础widgets教程-ButtonBar篇
159 0
|
iOS开发
Flutter基础widgets教程-CupertinoActivityIndicator篇
Flutter基础widgets教程-CupertinoActivityIndicator篇
190 0