当前位置:网站首页>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;
}
}
边栏推荐
- How do I turn on / off the timestamp when debugging the chrome console?
- Use xtradiagram Diagramcontrol for drawing and controlling process graphics
- Intel ® extensions for pytorch* accelerate pytorch
- Detailed explanation of serial port, com, UART, TTL, RS232 (485) differences
- Quartus call & Design d Trigger - simulation & time sequence Wave Verification
- Androd Gradle模块依赖替换如何使用
- OS的常见用法(图片示例)
- ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.
- Former amd chip architect roast said that the cancellation of K12 processor project was because amd counseled!
- Is it safe for flush to open an account online? What should we pay attention to
猜你喜欢

OS的常见用法(图片示例)

Go写文件的权限 WriteFile(filename, data, 0644)?

Crmeb second open SMS function tutorial

How did Tencent's technology bulls complete the overall cloud launch?

Deci 和英特尔如何在 MLPerf 上实现高达 16.8 倍的吞吐量提升和 +1.74% 的准确性提升

Digraph D and e

通过 OpenVINO Model Server和 TensorFlow Serving简化部署

In depth analysis of mobilenet and its variants

Tencent cloud tdsql-c heavy upgrade, leading the cloud native database market in terms of performance

爱思唯尔-Elsevier期刊的校稿流程记录(Proofs)(海王星Neptune)(遇到问题:latex去掉章节序号)
随机推荐
IEEE transaction journal revision process record
Former amd chip architect roast said that the cancellation of K12 processor project was because amd counseled!
Wechat applet pop up the optional menu from the bottom
Crmeb second open SMS function tutorial
pyqt5之designer制作表格
Xmake v2.6.8 release, compilation cache improvement
[Yunzhou said live room] - digital security special session will be officially launched tomorrow afternoon
串口、COM、UART、TTL、RS232(485)区别详解
构建英特尔 DevCloud
KDD 2022 | epileptic wave prediction based on hierarchical graph diffusion learning
OpenVINOTM 2022.1中AUTO插件和自动批处理的最佳实践
Use xtradiagram Diagramcontrol for drawing and controlling process graphics
Proofs of Elsevier Elsevier Journal (Neptune Neptune) (problems encountered: latex remove the chapter number)
Has aaig really awakened its AI personality after reading the global June issue (Part 1)? Which segment of NLP has the most social value? Get new ideas and inspiration ~
leetcode:242. Valid Letter ectopic words
vulnhub靶机Os-hackNos-1
【课程预告】基于飞桨和OpenVINO 的AI表计产业解决方案 | 工业读表与字符检测
Add Icon before input of wechat applet
Cifar announces the second stage pan Canadian AI strategy
leetcode:242. 有效的字母异位词