当前位置:网站首页>Shutter restraint container assembly
Shutter restraint container assembly
2022-06-11 06:55:00 【xiangxiongfly915】
Flutter Constrain container components
ConstrainedBox
Limit the size of sub assemblies , You can set the maximum value 、 minimum value .

ConstrainedBox(
constraints: const BoxConstraints(
minWidth: 50,
minHeight: 50,
maxHeight: 100,
maxWidth: 100,
),
child: Container(
width: 10,
height: 10,
color: Colors.red,
),
),
const SizedBox(height: 10),
ConstrainedBox(
constraints: const BoxConstraints(
minWidth: 50,
minHeight: 50,
maxHeight: 100,
maxWidth: 100,
),
child: Container(
width: 200,
height: 200,
color: Colors.red,
),
)
SizedBox
Set a fixed width and height for the subassembly . Similar in function to ConstrainedBox Components .

SizedBox(
width: 50,
height: 50,
child: Container(color: Colors.green),
),
const SizedBox(height: 10),
SizedBox.fromSize(
size: const Size(50, 50),
child: Container(color: Colors.green),
)
UnconstrainedBox
Used to remove constraints from parent components , Allow subcomponents to be drawn to their own size .

The red text will only be displayed in the debug Display in mode , stay release Only the blue area will be displayed in mode .
SizedBox(
width: 10,
height: 10,
child: UnconstrainedBox(
child: Container(width: 100, height: 100, color: Colors.blue),
),
)
边栏推荐
- 动态import
- Scripy web crawler series tutorials (I) | construction of scripy crawler framework development environment
- Summary and review
- QT script document translation (I)
- 六月集训(第11天) —— 矩阵
- LEARNING TARGET-ORIENTED DUAL ATTENTION FOR ROBUST RGB-T TRACKING
- Mediaextractor source code analysis of multimedia framework analysis (1)
- 懒加载,预加载
- The realization of online Fox game server room configuration battle engagement customization function
- 争议很大的问题
猜你喜欢

JS judge whether the year is a leap year and the number of days in the month

Scripy web crawler series tutorials (I) | construction of scripy crawler framework development environment

Simple integration of client go gin six list watch two (about the improvement of RS, pod and deployment)

Sohu employees encounter wage subsidy fraud. What is the difference between black property and gray property and how to trace the source?

Detailed explanation of mutual call between C language and Lua

563. 二叉树的坡度

Open source cartoon server mango

开源漫画服务器Mango

Difference between byte and bit

无心剑汉英双语诗001.《爱》
随机推荐
latex 各种箭头/带文字标号的箭头/可变长箭头
Summary of string processing skills III
Detailed explanation of mutual call between C language and Lua
争议很大的问题
June training (day 11) - matrix
Throttling and anti shake
Starting from scratch (V) realize bullet positioning and animation
JS judge whether the year is a leap year and the number of days in the month
Handwritten a message queue in two ways
网狐游戏服务器房间配置约战定制功能实现
Redux learning (I) -- the process of using Redux
The difference between TCP and UDP
JS implementation of Hill sort of graphic insertion sort [with source code]
socket. IO cross domain stepping pit
[MATLAB image fusion] particle swarm optimization adaptive multispectral image fusion [including source code phase 004]
Check whether the filing information of the medical representative is correct
Difference between byte and bit
Redux learning (II) -- encapsulating the connect function
Henan college entrance examination vs Tianjin college entrance examination (2008-2021)
About daily report plan