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

flutter: The following assertion was thrown during a scheduler callback:
flutter: There are multiple heroes that share the same tag within a subtree.
flutter: Within each subtree for which heroes are to be animated (i.e. a PageRoute subtree), each Hero must
flutter: have a unique non-null tag.
flutter: In this case, multiple heroes had the following tag: 
flutter: Here is the subtree for one of the offending heroes:
flutter: # Hero(tag: , state: _HeroState#49717)
在子树中有多个Hero 对象共用了一个tag,每个Hero对象的tag必须是惟一的。
并且指出了是FloatingActionButton中的tag有冲突

Flutter异常:There are multiple heroes that share the same tag within a subtree_第1张图片

所以需要设置 heroTag

Flutter异常:There are multiple heroes that share the same tag within a subtree_第2张图片

你可能感兴趣的:(flutter)