【问题标题】:How to make a custom Rotated Container in flutter?如何在颤动中制作自定义旋转容器?
【发布时间】:2022-01-24 23:23:30
【问题描述】:

我想在 Flutter 中制作类似于 spotify 搜索自定义容器的东西(查找附加的屏幕截图),但不能安静地做好。有什么建议?我还在学习flutter

【问题讨论】:

    标签: flutter


    【解决方案1】:

    你为什么不直接Transform 小部件?

    import 'dart:math' as math;
    
    Transform(
      alignment: Alignment.center,
      transform: Matrix4.rotationZ(math.pi / 6),
      child: YourContainer(),
    )
    

    import 'dart:math' as math;
    
    Transform(
      alignment: Alignment.center,
      transform: Matrix4.rotationZ(math.pi / 6),
      child: Image.asset('assets/images/pic.png', fit: BoxFit.cover),
    )
    

    【讨论】:

      猜你喜欢
      • 2020-10-13
      • 1970-01-01
      • 2023-01-20
      • 2021-02-08
      • 2020-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多