当前位置:网站首页>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
边栏推荐
- No monitoring information seen in kibana
- Old popup explorer Exe has stopped working due to problems. What should I do?
- Summary of common SSH commands
- Why use code signing? What certificates are required for code signing?
- How to choose excellent server hosting or server leasing in Beijing
- How to handle the uplink and downlink silence of TRTC
- [Numpy] Numpy对于NaN值的判断
- How to select the application of the server?
- Cross platform RDP protocol, RDP like protocol and non RDP protocol remote software
- 老弹出explorer.exe遇到问题已停止工作,怎么办?
猜你喜欢

SQL注入绕过安全狗思路一

老弹出explorer.exe遇到问题已停止工作,怎么办?

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

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

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

Old popup explorer Exe has stopped working due to problems. What should I do?
Thank you for your recognition! One thank-you note after another

Black hat SEO actual combat directory wheel chain generates millions of pages in batch
![[code Capriccio - dynamic planning] t392 Judgement subsequence](/img/59/9da6d70195ce64b70ada8687a07488.png)
[code Capriccio - dynamic planning] t392 Judgement subsequence

黑帽SEO实战之目录轮链批量生成百万页面
随机推荐
Installation of pytorch in pycharm
Ar 3D map technology
Chapter 6: UART echo case of PS bare metal and FreeRTOS case development
Several key tools for cloud native implementation
Understand Devops from the perspective of leader
web渗透测试----5、暴力破解漏洞--(2)SNMP密码破解
Dialogue with Google technical experts: soundstream is expected to be used for general audio coding in the future
4. go deep into tidb: detailed explanation of the implementation process of the implementation plan
Web penetration test - 5. Brute force cracking vulnerability - (4) telnet password cracking
How do websites use CDN? What are the benefits of using it?
Grpc: how to add API log interceptors / Middleware?
Grpc: how to make grpc provide swagger UI?
What is the difference between server leasing and hosting?
Rasa 3. X learning series -rasa 3.2.0 new release
golang clean a slice
LeetCode 2006. Number of pairs whose absolute value of difference is k
Gaussian beam and its matlab simulation
Cloud development RMB 1 purchase activity is in progress
LeetCode 129. Find the sum of numbers from root node to leaf node
Hprof information in koom shark with memory leak