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",
    ...
)

Loading

Views: 29
Total Views: 1733 ,

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome content in your inbox.

We don’t spam! Read our privacy policy for more info.

Oh hi there 👋 It’s nice to meet you.

Sign up to receive awesome content in your inbox.

We don’t spam! Read our privacy policy for more info.

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Thank you so much!