-
Notifications
You must be signed in to change notification settings - Fork 2
/
transform.dart
72 lines (69 loc) · 2.12 KB
/
transform.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import 'package:flutter/material.dart';
class TransformExample extends StatefulWidget {
TransformExample({Key key}) : super(key: key);
@override
_TransformExampleState createState() => _TransformExampleState();
}
class _TransformExampleState extends State<TransformExample> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
),
Transform(
transform: Matrix4.skew(0.1, 0.2),
child: Container(
height: 100.0,
width: 100.0,
color: Colors.orange,
),
),
Padding(
padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
),
Transform.rotate(
angle: 1.0,
child: Container(
color: Colors.green,
height: 100.0,
width: 100.0,
),
),
Padding(
padding: EdgeInsets.only(top: 20.0, bottom: 40.0),
),
Transform.scale(
scale: 2.0,
child: Container(
decoration: BoxDecoration(
color: Colors.purple,
borderRadius: BorderRadius.all(Radius.circular(100.0))),
height: 50.0,
width: 50.0,
),
),
Padding(
padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
),
Transform.translate(
offset: Offset(50.0, 0.0),
child: Container(
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 100.0,
width: 100.0,
),
),
],
),
),
),
);
}
}