当前位置:网站首页>Flutter series: Transformers in flutter
Flutter series: Transformers in flutter
2022-06-27 23:59:00 【InfoQ】
brief introduction
Transform brief introduction
class Transform extends SingleChildRenderObjectWidget
const Transform({
Key? key,
required this.transform,
this.origin,
this.alignment,
this.transformHitTests = true,
this.filterQuality,
Widget? child,
}) : assert(transform != null),
super(key: key, child: child);
Transform.rotate({
Key? key,
required double angle,
this.origin,
this.alignment = Alignment.center,
this.transformHitTests = true,
this.filterQuality,
Widget? child,
}) : transform = Matrix4.rotationZ(angle),
super(key: key, child: child);
Transform.translate({
Key? key,
required Offset offset,
this.transformHitTests = true,
this.filterQuality,
Widget? child,
}) : transform = Matrix4.translationValues(offset.dx, offset.dy, 0.0),
origin = null,
alignment = null,
super(key: key, child: child);
Transform.scale({
Key? key,
required double scale,
this.origin,
this.alignment = Alignment.center,
this.transformHitTests = true,
this.filterQuality,
Widget? child,
}) : transform = Matrix4.diagonal3Values(scale, scale, 1.0),
super(key: key, child: child);
Transform Use
Widget build(BuildContext context) {
return Center(
child: Transform.rotate(
angle: pi/4,
child: const Icon(
Icons.airplanemode_active,
size: 200,
color: Colors.blue,
),
));
}

return Transform.translate(
offset:const Offset(50.0, 100.0),
child: const Icon(
Icons.airplanemode_active,
size: 200,
color: Colors.blue,
),
);

return Transform.scale(
scale: 0.5,
child: const Icon(
Icons.airplanemode_active,
size: 200,
color: Colors.blue,
),
);

summary
边栏推荐
猜你喜欢
Swing UI container (I)
[digital ic/fpga] detect the position of the last matching sequence
An analysis of C language functions
【微服务|Sentinel】sentinel数据持久化
[sword finger offer] 47 Maximum value of gifts
本地可视化工具连接阿里云centOS服务器的redis
Transmitting and receiving antenna pattern
Teach you how to transplant tinyriscv to FPGA
零基础自学SQL课程 | CASE函数
零基础自学SQL课程 | SQL基本函数大全
随机推荐
What if Fiddler fails to listen to the interface
Eliminate gaps around El image images
Prediction of benign / malignant breast tumors (logistic regression classifier)
浙江大学课程攻略共享计划
c语言之字符串数组
Zero foundation self-study SQL course | complete collection of date functions in SQL
Sell notes | brief introduction to video text pre training
seata
Are the registered accounts of the top ten securities companies safe and risky?
[PCL self study: pclplotter] pclplotter draws data analysis chart
[try to hack] kill evaluation
智慧风电 | 图扑软件数字孪生风机设备,3D 可视化智能运维
【tinyriscv verilator】分支移植到正点原子达芬奇开发板
Halcon's region: features of multiple regions (6)
单细胞数据清洗的这5个步骤你会做吗?
virtualbox扩展动态磁盘大小的坑
SQL中IS NOT NULL与!=NULL的区别
2022年PMP项目管理考试敏捷知识点(3)
An analysis of C language functions
Applet referer