当前位置:网站首页>[shutter component] expanded detailed explanation
[shutter component] expanded detailed explanation
2022-07-22 14:09:00 【It Zhi male】
Expanded characteristic
- Only in
Column
,Row
,Flex
And their subcomponents , This refers to sub components rather than sub nodes , Means inheritanceColumn
,Row
,Flex
The child components . Expanded
The parent node of must beColumn
,Row
,Flex
And their subcomponents , It can't beColumn->Container->Expanded
( Indicates the node path )- In the use of
Expanded
when , If there isList
Node of type , such asSingleChildScrollView
, perhapsListTile
etc. , Its sliding direction should be consistent withExpanded
The filling direction is different , Otherwise, it will report a mistake . Expanded
Role is , Fill the remaining space .
class Expanded extends Flexible {
/// Creates a widget that expands a child of a [Row], [Column], or [Flex]
/// so that the child fills the available space along the flex widget's
/// main axis.
const Expanded({
Key? key,
int flex = 1,
required Widget child,
}) : super(key: key, flex: flex, fit: FlexFit.tight, child: child);
}
flex
: Is the coefficient of elasticity , The higher the elastic coefficient , The more space it takes , Be similar toAndroid
NativeLinearLayout
Ofweight
attribute .child
: Child node
Example
flutter
Code
Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Column(
children: [
Expanded(
flex: 1,
child: Container(
color: Colors.black,
)),
Expanded(
flex: 2,
child: Container(
color: Colors.red,
)),
Expanded(
flex: 1,
child: Container(
color: Colors.blue,
))
],
), // This trailing comma makes auto-formatting nicer for build methods.
);
Screenshot
边栏推荐
- C语言简易小游戏
- Load and display the label information of raincityspaces
- Super dry! Thoroughly understand the differences and connections between simplex, half duplex and full duplex
- 寻找斐波那契数
- Talk about how programmers improve their writing ability
- Do you have to follow flush privileges after MySQL grant?
- Machine learning - Integrated Learning
- The 22 pictures show you in-depth analysis of prefix, infix, suffix expressions and expression evaluation
- Interview project preparation | how to show the project to the interviewer?
- 实习打怪之路:什么是回调函数(听了这么久的回调函数,到底什么才是回调函数)
猜你喜欢
Hot pot restaurant ordering system based on ssm+jsp+mysql+h-ui
Concurrency opening -- take you from 0 to 1 to build the cornerstone of concurrency knowledge system
22张图带你深入剖析前缀、中缀、后缀表达式以及表达式求值
Redis分布式锁,没它真不行!
并发开篇——带你从0到1建立并发知识体系的基石
C语言简易小游戏
PyTorch(四)——PyTorch模型定义
8. ZABBIX distributed
C language simple games
Redis数据结构分析(一)
随机推荐
Salted fish self rescue guide -- typescript about interfaces
Network metering - transport layer
JUC thread pool
Restore the word form of the sentence
Is it safe for Huatai Securities to open an account? Can the handling charge be in case?
软件测试禅道是什么?如何使用?
C language simple games
实习打怪之路:JS中检测数据类型的方法
ABAP grammar foundation 2
文件操作下(C语言)
ASM学习系列(二)
MySQL调优(D)
Easy gene | how to do the simplified genomic DNA methylation sequencing (RRBs) experiment?
3.zabbix安装
Super dry! Thoroughly understand the differences and connections between simplex, half duplex and full duplex
ABAP语法基础3
Hot pot restaurant ordering system based on ssm+jsp+mysql+h-ui
2.zabbix概念
Which pits of BigDecimal precision
Daily question C language 9