How do I rotate something 15 degrees in Flutter?

前端 未结 3 1570
夕颜
夕颜 2021-02-02 05:15

The Flutter docs show an example of rotating a \"div\" by 15 degrees, both for HTML/CSS and Flutter code:

The Flutter code is:

var container = new Contai         


        
3条回答
  •  醉话见心
    2021-02-02 06:03

    You can use Transform.rotate to rotate your widget. I used Text and rotated it with 45˚ (π/4)

    Example:

    import 'dart:math' as math;
    
    Transform.rotate(
      angle: -math.pi / 4,
      child: Text('Text'),
    )
    

提交回复
热议问题