当前位置:网站首页>Get to know the drawing component of flutter - custompaint
Get to know the drawing component of flutter - custompaint
2022-06-25 04:45:00 【Ma Nong on the island】
brief introduction
In some scenes , We will need to draw some highly customized components , such as UI The designer gave us a problem —— Make a strange frame . witness UI The designer is for the sake of a beautiful little sister , I'm sorry to say this can't be done ( That's also very shameful ). At this time, we can't directly use Flutter The self-contained components , Instead, you need to draw the components manually , Then you need to use CuntomPaint Components .CustomPaint Components and front end Canvas almost , Allows us to draw various elements on a canvas , Including some 、 Line 、 rectangular 、 arc 、 written words 、 Pictures, etc. .
CustomPaint Introduce
CustomPaint It's a Widget, There are three important parameters :
CustomPaint(
child: childWidget(),
foregroundPainter: foregroundPainter(),
painter: backgroundPainter(),
)
child:CustomPaintThe child components ;painterandforegroundPainter: All areCustomPainterclass , Used for definitioncanvasThe content of the drawing . The difference lies in , The first is executionpainterThe drawing instructions of . Then render on the backgroundchildChild components . Last ,foregroundPainterThe contents of will be drawn
边栏推荐
- 30岁了开始自学编程,家里比较困难还来得及吗?
- "Daily practice, happy water" 1108 IP address invalidation
- Web3 DApp用户体验最佳实践
- GBASE 8s的数据导入和导出
- [Flink] problems and solutions of the continuous growth of checkpoint size in rocksdb incremental mode
- Package for gbase 8s
- 写shell脚本报错总结
- Basic introduction of gbase 8s blocking technology
- Cnpm: unable to load file c:\users\administrator\appdata\roaming\npm\cnpm PS1 because running scripts is prohibited on this system.
- GBASE 8s的并行操作问题场景描述
猜你喜欢
随机推荐
515. find the maximum value / Sword finger offer II 095 in each tree row Longest common subsequence
GBASE 8s存储过程语法结构
OOP 向量加减(友元+拷贝构造)
为什么TCP握手刚刚好是3次呢?
固态硬盘开盘数据恢复的方法
Use text analysis to identify the main gender in a text
GBASE 8s存储过程流程控制
STM32的DMA双缓冲模式详解
Kotlin Compose 监听软键盘 点击enter提交事件
魔法猪系统重装大师怎么使用
Record the problem of C # print size once
第九章 APP项目测试(2) 测试工具
olap分析引擎——Kylin4.0
DMA double buffer mode of stm32
Vscade setting clang format
2.0springmvc uses restful
unity Quad剔除背面并剔除透明部分的shader
At the age of 30, I began to learn programming by myself. Is it still time for me to have difficulties at home?
Deep learning - several types of learning
CTF_ Web: Changan cup-2021 old but a little new & asuka









