Flutter-具有HeroTag动画的FloatingActionButton到其他FloatingActionButton

问题描述 投票:0回答:1

我在不同页面中有差异FloatingActionButtons。我想使用浮动按钮和HeroTag对此页面进行动画处理。

当我单击第1页的按钮时,我要对此进行动画处理并推送到第二页

第1页:按钮

FloatingActionButton(
                          heroTag: "map",
                        elevation: 20.0,
                        shape: CircleBorder(
                            side: BorderSide(color: Colors.black, width: 1.0)),
                        backgroundColor: Colors.blue[300],
                        onPressed: () {
                          setState(() {
                           //PUSH
                          });
                        Icon(Icons.arrow_forward_ios)
                        },

第2页:按钮

FloatingActionButton(
                      heroTag: "map",
                    elevation: 20.0,
                    shape: CircleBorder(
                        side: BorderSide(color: Colors.black, width: 1.0)),
                    backgroundColor: Colors.blue[300],
                    onPressed: () {
                      setState(() {
                         //PUSH
                      });
                     Icon(Icons.arrow_back_ios),
                    },

动画不起作用,什么也没做。

所以:在FloatingActionButtons中制作英雄动画的正确方法是什么?

我在不同页面中有不同的FloatingActionButtons。我想使用浮动按钮和HeroTag为这些页面设置动画。当我单击页面1的按钮时,我要对此进行动画处理并推到第二个...

flutter flutter-layout
1个回答
0
投票

在某些情况下应有助于删除heroTag属性

© www.soinside.com 2019 - 2024. All rights reserved.