You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I am using the PhotoViewInline widget wrapped in a Card widget and displaying multiple Cards in a ListView.
So it worked fine until I tried to navigate to another context and Flutter started throwing this error:
There are multiple heroes that share the same tag within a subtree. Within each subtree for which heroes are to be animated (typically a PageRoute subtree), each Hero must have a unique non-null tag. In this case, multiple heroes had the following tag: nohero Here is the subtree for one of the offending heroes: # Hero(tag: nohero, state: _HeroState#db290)
I traced the Widget Tree until I found that PhotoViewInline didn't have a unique heroTag
, and thus when it calls its build method which has a PhotoView it will have a "nohero" heroTag.
I was able to fix this by adding a heroTag Object in the constructor of PhotoViewInline and passing that in the build method to the PhotoView heroTag like so:
So I am using the PhotoViewInline widget wrapped in a Card widget and displaying multiple Cards in a ListView.
So it worked fine until I tried to navigate to another context and Flutter started throwing this error:
There are multiple heroes that share the same tag within a subtree. Within each subtree for which heroes are to be animated (typically a PageRoute subtree), each Hero must have a unique non-null tag. In this case, multiple heroes had the following tag: nohero Here is the subtree for one of the offending heroes: # Hero(tag: nohero, state: _HeroState#db290)
I traced the Widget Tree until I found that PhotoViewInline didn't have a unique heroTag
, and thus when it calls its build method which has a PhotoView it will have a "nohero" heroTag.
I was able to fix this by adding a heroTag Object in the constructor of PhotoViewInline and passing that in the build method to the PhotoView heroTag like so:
Should I create a Pull Request with the fix?
The text was updated successfully, but these errors were encountered: