如何在Flutter中实现自定义旋转容器/小部件?

时间:2019-03-20 21:21:41

标签: flutter flutter-animation

我想实现这种效果,但是idk从哪里开始。 https://uimovement.com/ui/7370/explore-recipes/

我尝试使用AnimatedContainers,但也许是错误的小部件。

我需要一些建议或示例,以开始或研究。

这是我的伪代码:

  @override
  Widget build(BuildContext context) {
    return new Container(
      alignment: Alignment.center,
      color: Colors.white,
      child: new AnimatedBuilder(
        animation: animationController,
        child: new Container(
          height: 300.0,
          width: 300.0,
          child: new Image.asset('images/food.png'),
        ),
        builder: (BuildContext context, Widget _widget) {
          return new Transform.rotate(
            angle: animationController.value * 6.3,
            child: _widget,
          );
        },
      ),
    );
  }

0 个答案:

没有答案