当前位置:网站首页>Flutter series: offstage in flutter
Flutter series: offstage in flutter
2022-06-24 03:48:00 【InfoQ】
brief introduction
Offstage Detailed explanation
class Offstage extends SingleChildRenderObjectWidget
const Offstage({ Key? key, this.offstage = true, Widget? child })
: assert(offstage != null),
super(key: key, child: child);
RenderOffstage createRenderObject(BuildContext context) => RenderOffstage(offstage: offstage);
void paint(PaintingContext context, Offset offset) {
if (offstage)
return;
super.paint(context, offset);
}
Offstage Use
State<OffstageApp>Offstage(
offstage: _offstage,
child: SizedBox(
key: _key,
width: 150.0,
height: 150.0,
child: Container(
color: Colors.red,
),
),
)
ElevatedButton(
child: const Text(' Switch offstage'),
onPressed: () {
setState(() {
_offstage = !_offstage;
});
},
),
ElevatedButton(
child: const Text(' testing SizedBox size '),
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content:
Text('SizedBox is ${_getSizedBoxSize()}'),
),
);
})
Size _getSizedBoxSize() {
final RenderBox renderBox =
_key.currentContext!.findRenderObject()! as RenderBox;
return renderBox.size;
}



summary
边栏推荐
- How to bypass CDN to get web pages? How many options are available?
- Summary of common SSH commands
- What is edge computing? What are the characteristics of the Internet platform edge calculator?
- Implement the throttling de dithering function
- Differences between EDI and VMI
- Independent innovation and localization technology: SMT production line monitoring and management visualization of intelligent manufacturing
- Chapter 6: UART echo case of PS bare metal and FreeRTOS case development
- What does elastic scaling of cloud computing mean? What are the application scenarios for elastic scaling of cloud computing?
- [congratulations] rock solid! A new generation of AMD Blackstone architecture instance is launched!
- How to save pictures to CDN? What are the advantages of this?
猜你喜欢

黑帽SEO实战之通用301权重pr劫持

On game safety (I)

618大促:手机品牌“神仙打架”,高端市场“谁主沉浮”?

Halcon knowledge: contour operator on region (2)

JVM调优简要思想及简单案例-怎么调优

Clickhouse (02) Clickhouse architecture design introduction overview and Clickhouse data slicing design

元气森林推“有矿”,农夫山泉们跟着“卷”?

黑帽SEO实战搜索引擎快照劫持

黑帽SEO实战之目录轮链批量生成百万页面

618 promotion: mobile phone brand "immortal fight", high-end market "who dominates the ups and downs"?
随机推荐
4. go deep into tidb: detailed explanation of the implementation process of the implementation plan
Hprof information in koom shark with memory leak
Technical dry goods - how to use AI technology to accurately identify mining Trojans
Record the creation process of a joke widget (II)
Coding Ci of Devops
Life reopens simulation / synthetic big watermelon / small air conditioner Inventory of 2021 popular open source projects
[Numpy] Numpy对于NaN值的判断
LeetCode 2006. Number of pairs whose absolute value of difference is k
Why do I need a code signing certificate? Where can I get a code signing certificate?
halcon知识:区域(Region)上的轮廓算子(2)
Grpc: how to make grpc provide restful API services?
在pycharm中pytorch的安装
web渗透测试----5、暴力破解漏洞--(4)Telnet密码破解
Cloud development RMB 1 purchase activity is in progress
Industrial security experts talk about how to build security protection capability for government big data platform?
How to save pictures to CDN? What are the advantages of this?
Black hat SEO actual combat search engine snapshot hijacking
Independent innovation and localization technology: SMT production line monitoring and management visualization of intelligent manufacturing
Rasa 3. X learning series -rasa 3.2.0 new release
The medical technology giant was blackmailed and Microsoft announced 74 security vulnerabilities | global network security hotspot