Flutter RotatedBox旋转容器

在这里插入图片描述

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
// RotatedBox旋转容器,4次算一次循环
class RotatedBoxDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        children: [
          RotatedBox(
            child: Text('ABCDEF', style: TextStyle(fontSize: 28.0),),
            // 旋转次数
            quarterTurns: 1,
          ),
          SizedBox(height: 20,),
          RotatedBox(
            child: Text('ABCDEF', style: TextStyle(fontSize: 28.0),),
            // 旋转次数
            quarterTurns: 2,
          ),
          SizedBox(height: 20,),
          RotatedBox(
              child: Text('ABCDEF', style: TextStyle(fontSize: 28.0),),
              // 旋转次数
              quarterTurns: 3,
          ),
          SizedBox(height: 20,),
          RotatedBox(
            child: Text('ABCDEF', style: TextStyle(fontSize: 28.0),),
            // 旋转次数
            quarterTurns: 4,
          ),
        ],
      ),
    );
  }
}