当前位置:网站首页>Shutter clip clipping component
Shutter clip clipping component
2022-06-23 13:54:00 【xiangxiongfly915】
List of articles
Flutter Clip Clipping components
sketch
Flutter Some clipping tools are provided , For clipping components .
Use
Original picture

Image.asset("images/avatar.jpg", width: 100, height: 100);
ClipRect
Rectangular clipping .

ClipRect(
child: Align(
child: avatar,
alignment: Alignment.topCenter,
heightFactor: 0.5,
),
)
ClipOval
Round cut .

ClipOval(
child: avatar,
clipBehavior: Clip.antiAlias, // Anti-Aliasing , Usually used to deal with circles and arcs
)
ClipRRect
Rectangle fillet clipping .

ClipRRect(
child: avatar,
borderRadius: BorderRadius.circular(10),
)
ClipPath
Path clipping .
shape:ShapeBorder type , Define clipping shapes .
- RoundedRectangleBorder: Rounded rectangle .
- ContinuousRectangleBorder: Smooth transition between line and fillet , And RoundedRectangleBorder similar , But the fillet effect is smaller .
- StadiumBorder: Like a football field , Half round at both ends .
- BeveledRectangleBorder: Beveled rectangle .

ClipPath.shape(
shape: const StadiumBorder(),
child: SizedBox(
width: 100,
height: 60,
child: Image.asset("images/avatar.jpg", fit: BoxFit.cover),
),
),
Custom clipping

Container(
color: Colors.red,
child: ClipRect(
clipper: MyClipper1(),
child: avatar,
),
)
class MyClipper1 extends CustomClipper<Rect> {
@override
Rect getClip(Size size) {
return const Rect.fromLTWH(0, 0, 30, 30);
}
@override
bool shouldReclip(covariant CustomClipper<Rect> oldClipper) {
return false;
}
}

Container(
color: Colors.green,
child: ClipPath(
clipper: TrianglePath(),
child: avatar,
),
)
class TrianglePath extends CustomClipper<Path> {
@override
Path getClip(Size size) {
var path = Path();
path.moveTo(size.width / 2, 0);
path.lineTo(0, size.height);
path.lineTo(size.width, size.height);
path.close();
return path;
}
@override
bool shouldReclip(covariant CustomClipper<Path> oldClipper) {
return true;
}
}
边栏推荐
- MySQL single database and table splitting using MYCAT
- 串口、COM、UART、TTL、RS232(485)区别详解
- Former amd chip architect roast said that the cancellation of K12 processor project was because amd counseled!
- In depth analysis of mobilenet and its variants
- windows 安装 MySQL
- Xmake v2.6.8 发布,编译缓存改进
- Stick to five things to get you out of your confusion!
- Cifar announces the second stage pan Canadian AI strategy
- Simplify deployment with openvino model server and tensorflow serving
- 有向图D和E
猜你喜欢

Gradle Build Cache引发的Task缓存编译问题怎么解决

Intelligent digital signage solution

怎么手写vite插件

Flex attribute of wechat applet

【课程预告】基于飞桨和OpenVINO 的AI表计产业解决方案 | 工业读表与字符检测

Wechat applet pop up the optional menu from the bottom

OpenVINOTM 2022.1中AUTO插件和自动批处理的最佳实践

How to correctly calculate the number of rows imported into EXCEL (poi/npoi)

Digraph D and e

Crmeb second open SMS function tutorial
随机推荐
Hanyuan high tech new generation green energy-saving Ethernet access industrial switch high efficiency energy-saving Gigabit Industrial Ethernet switch
Service stability governance
微信小程序之input前加图标
[Course preview] AI meter industry solution based on propeller and openvino | industrial meter reading and character detection
爱思唯尔-Elsevier期刊的校稿流程记录(Proofs)(海王星Neptune)(遇到问题:latex去掉章节序号)
【深入理解TcaplusDB技术】Tmonitor系统升级
DBMS in Oracle_ output. put_ How to use line
quartus调用&设计D触发器——仿真&时序波验证
vulnhub靶机Os-hackNos-1
Common usage of OS (picture example)
32-way telephone +2-way Gigabit Ethernet 32-way PCM telephone optical transceiver supports FXO port FXS voice telephone to optical fiber
Gary Marcus wrote: three perspectives from linguists that AI researchers need to know
First exposure! The only Alibaba cloud native security panorama behind the highest level in the whole domain
AI 参考套件
Digraph D and e
One way linked list implementation -- counting
Intelligent digital signage solution
#yyds干货盘点# 解决剑指offer: 判断是不是平衡二叉树
Architecture design methods in technical practice
Use openvinotm preprocessing API to further improve the reasoning performance of yolov5