Skip to content

Commit 63bf655

Browse files
author
Magic
committed
Merge branch 'magic' into dev
2 parents 81d1cd2 + 6fce888 commit 63bf655

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

docs/widget/vision/transform/index.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
1-
## **文档完善中**
1+
## **Transform**
2+
3+
> 在绘制子元素前应用转换的组件
4+
5+
### 构造方法
6+
```
7+
Transform({
8+
Key key,
9+
@required Matrix4 transform,
10+
Offset origin,
11+
AlignmentGeometry alignment,
12+
bool transformHitTests: true,
13+
Widget child
14+
})
15+
```
16+
17+
### 属性介绍
18+
origin:坐标系的原点(相对于此渲染对象的左上角)应用矩阵的原点
19+
alignment:原点的对齐方式
20+
transform: 在绘制过程中改变子元素的矩阵
21+
transformHitTests:在测试时是否执行转换
22+
23+
24+
### 实例

lib/widget/vision/transform/demo.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ class _IndexState extends State<Index> {
1515
Widget build(BuildContext context) {
1616
return Scaffold(
1717
appBar: AppBar(
18-
title: Text('SingleChildScrollView'),
18+
title: Text('Transform'),
1919
),
20-
body: Center(
21-
child: Text('更新中'),
20+
body: Transform(
21+
alignment: Alignment.center,
22+
transform: Matrix4.skewY(0.1),
23+
child: Container(
24+
padding: const EdgeInsets.all(8.0),
25+
color: const Color(0xFFE8581C),
26+
child: const Text('Apartment for rent!'),
27+
),
2228
),
2329
);
2430
}

0 commit comments

Comments
 (0)