如何用旋转动画更改两个图像(小部件)?

时间:2019-07-30 18:55:02

标签: flutter dart flutter-animation

单击第一张图像,然后切换第二张图像。并且第二张图片也应该显示在背面

Stack(
          children: <Widget>[
            Positioned(
                child: GestureDetector(
              child: Container(
                height: 100,
                width: 100,
                color: Colors.red,
              ),
              onTap: () {
                setState(() {
                  showMessage = true;
                });
              },
            )),
            AnimatedPositioned(
              child: Container(
                height: 50,
                width: 50,
                color: showMessage? Colors.green:Colors.blue,
              ),
              duration: Duration(seconds: 5),
              bottom: showMessage ? 70 : 10,
              right: 10,
            )
          ],
        )

切换时图像应该旋转

enter image description here

0 个答案:

没有答案