当前位置:网站首页>flutter系列之:flutter中的变形金刚Transform
flutter系列之:flutter中的变形金刚Transform
2022-06-27 21:23:00 【InfoQ】
简介
Transform简介
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的使用
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,
),
);

总结
边栏推荐
- Use of go log package log
- halcon之区域:多种区域(Region)特征(6)
- Pat class B 1013
- After a period of silence, I came out again~
- 十大券商注册账户安全吗,会有风险吗?
- 发射,接收天线方向图
- 撰写外文时怎样引用中文文献?
- It supports deleting and updating the priority queue of any node
- ClickOnce error deploying ClickOnce application - the reference in the manifest does not match the identity of the downloaded assembly
- c语言之字符串数组
猜你喜欢

The file or assembly 'cefsharp.core.runtime.dll' or one of its dependencies could not be loaded. Is not a valid Win32 Application. (exception from hresult:0x800700c1)
![[PCL self study: pclvisualizer] point cloud visualization tool pclvisualizer](/img/38/c7ce908bfcc5cc5cd5856996aa015b.png)
[PCL self study: pclvisualizer] point cloud visualization tool pclvisualizer

【Try to Hack】veil-evasion免杀

Zero foundation self-study SQL course | case function

c语言字符指针、字符串初始化问题

2022 PMP project management examination agile knowledge points (3)

Stream + Nacos

webserver流程图——搞懂webserver各模块间调用关系

未能加载文件或程序集“CefSharp.Core.Runtime.dll”或它的某一个依赖项。 不是有效的 Win32 应用程序。 (异常来自 HRESULT:0x800700C1)
![[PCL self study: segmentation4] point cloud segmentation based on Min cut](/img/af/a6c5abf357c1db0718df505499df70.png)
[PCL self study: segmentation4] point cloud segmentation based on Min cut
随机推荐
webService
golang使用mongo-driver操作——查(进阶)
Golang uses Mongo driver operation - query (Advanced)
抓出那些重复的基因
思源笔记订阅停止直接删云端数据嘛?
Cornernet understands from simple to profound
Can you do these five steps of single cell data cleaning?
VMware virtual machine bridging connectivity
[AI application] detailed parameters of Jetson Xavier nx
One step forward is excellent, one step backward is ignorant
搭建开源美观的数据库监控系统-Lepus
c语言字符指针、字符串初始化问题
[learn FPGA programming from scratch -48]: Vision - development and application of intelligent sensors
通过中金证券经理的开户二维码开股票账户安全吗?还是去证券公司开户安全?
Course strategy sharing plan of Zhejiang University
[从零开始学习FPGA编程-48]:视野篇 - 智能传感器的发展与应用
Feign implements path escape through custom annotations
Google Earth engine (GEE) 03 vector data type
【tinyriscv verilator】分支移植到正点原子达芬奇开发板
发射,接收天线方向图