当前位置:网站首页>Shutter fittedbox component
Shutter fittedbox component
2022-06-25 04:15:00 【xiangxiongfly915】
List of articles
Flutter FittedBox Components
sketch
When the aspect ratio of the child component is different from that of the parent component , Sure FittedBox Component operations child components stretch or fill the space of the parent component .
Basic attributes
fit: How child elements are filled .
- fill: Populate parent component .
- contain: Isometric stretching .
- cover: The proportional stretch fills the parent component , As small as possible .
- fitWidth: Isometric stretching , The width fills the parent component .
- fitHeight: Isometric stretching , Highly filled with parent components .
- none: The default subcomponent is centered , Don't deal with it .
- scaleDown: Zoom to contain, Otherwise none equally .
Use



const Text(" Original picture "),
Container(
width: 100,
height: 100,
color: Colors.red,
child: const Image(image: AssetImage("images/bird.jpg")),
),
const Text("BoxFit.fill"),
Container(
width: 100,
height: 100,
color: Colors.red,
child: const FittedBox(
fit: BoxFit.fill,
child: Image(image: AssetImage("images/bird.jpg")),
),
),
const SizedBox(height: 20),
const Text("BoxFit.contain"),
Container(
width: 100,
height: 100,
color: Colors.red,
child: const FittedBox(
fit: BoxFit.contain,
child: Image(image: AssetImage("images/bird.jpg")),
),
),
const SizedBox(height: 20),
const Text("BoxFit.cover"),
Container(
width: 100,
height: 100,
color: Colors.red,
child: const FittedBox(
fit: BoxFit.cover,
child: Image(image: AssetImage("images/bird.jpg")),
),
),
const SizedBox(height: 20),
const Text("BoxFit.fitWidth"),
Container(
width: 100,
height: 100,
color: Colors.red,
child: const FittedBox(
fit: BoxFit.fitWidth,
child: Image(image: AssetImage("images/bird.jpg")),
),
),
const SizedBox(height: 20),
const Text("BoxFit.fitHeight"),
Container(
width: 100,
height: 100,
color: Colors.red,
child: const FittedBox(
fit: BoxFit.fitHeight,
child: Image(image: AssetImage("images/bird.jpg")),
),
),
const SizedBox(height: 20),
// const Text("BoxFit.none"),
// Container(
// width: 100,
// height: 100,
// color: Colors.red,
// child: const FittedBox(
// fit: BoxFit.none,
// child: Image(image: AssetImage("images/bird.jpg")),
// ),
// ),
const SizedBox(height: 20),
const Text("BoxFit.scaleDown"),
Container(
width: 100,
height: 100,
color: Colors.red,
child: const FittedBox(
fit: BoxFit.scaleDown,
child: Image(image: AssetImage("images/bird.jpg")),
),
)
边栏推荐
- Siddhartha: the book of life can be regurgitated frequently
- Development of trading system (VI) -- HFT high frequency trading
- Development of trading system (XIII) -- Analysis of quickfix source code
- Crawler crawls Sina Weibo data
- client-go gin的简单整合十一-Delete
- 1280_ C language to find the average value of two unsigned integer
- Hello CTP (IV) - CTP transaction API
- 《Missing Parts》NFT 作品集第 5 系列上线 The Sandbox 市场平台
- Understand (DI) dependency injection in PHP
- openmmlab-环境配置
猜你喜欢

AI quantitative transaction (II) -- tushare financial data framework

Development of trading system (VI) -- HFT high frequency trading

讲座记录《多种空间大地测量技术的数据处理方法和应用》

练习:仿真模拟福彩双色球——中500w巨奖到底有多难?跑跑代码就晓得了。

1. first knowledge of chromatic harmonica

opencv是开源的吗?

2.吹响半音阶口琴

【Proteus仿真】Arduino UNO按键控制数码管闪烁增/减显示

讲座记录《捷联惯导解算的历史及发展》

Cesium 拖拽3D模型
随机推荐
Crawler grabs the idea of reading on wechat
MySQL插入过程报错1062,但是我没有该字段。
DAP数据调度功能完善说明
SQL, CTE, FLG CASE问题
Simple integration of client go gin 11 delete
[harmony OS] [arkui] ETS development graphics and animation drawing
1. first knowledge of chromatic harmonica
Jilin University 22 spring March "technical economics" assignment assessment-00073
[openwrt] we recommend a domestically developed version of openwrt, an introduction to istoreos. It is very easy to use. It is mainly optimized. It solves the problem of Sinicization.
Openmmlab environment configuration
Crawler grabs the data of Douban group
The art of writing simple code
2022-06-21-Flink-49(一. SQL手册)
《悉达多》:一生之书,可以时常反刍
Cesium loading display thermal diagram
JS tool function, self encapsulating a throttling function
On the self-cultivation of an excellent red team member
【LeetCode】22. 括号生成
Lecture record: history and development of strapdown inertial navigation solution
SEO的5大关键指标:排名+流量+会话+停留时长+跳出率