Flutter: There are multiple heroes that share the same tag within a subtree

When I try to put multiple FloatingActionButton in a page, it will show the below error:

There are multiple heroes that share the same tag within a subtree

This is because need to set the heroTag in each FloatingActionButton , so the solution is as below:

new FloatingActionButton(
    heroTag: "btn1",
    ...
)

new FloatingActionButton(
    heroTag: "btn2",
    ...
)

5,825 total views, 12 views today

Share your vote!


Do you like this post?
  • Fascinated
  • Happy
  • Sad
  • Angry
  • Bored
  • Afraid

You may also like...

shares