Skip to content

Commit 6fce888

Browse files
author
Magic
committed
更新代码
1 parent 9d040bd commit 6fce888

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed
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/config/index.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'development.dart' as Development;
22
import 'production.dart' as Production;
33

4-
const bool isPro = true;
4+
const bool isPro = false;
55

66
Object env = isPro ? Production.Config() : Development.Config();

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)