[Flutter] There are multiple heroes that share the same tag within a subtree.

etc-image-0

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

 

FloatingActionButtonHero 위젯을 사용하는데, 동일한 하위 트리에서 FloatingActionButton을 사용할 경우 Hero 태그 간에 충돌이 발생할 수 있기 때문에 위젯마다 고유한 heroTag를 지정해줘야 한다.

 

FloatingActionButton(
    heroTag: 'timeline', // ✅추가
    onPressed: () => navigate(Routes.timelineForm),
    child: const Icon(Icons.edit),
)

 

FloatingActionButton 위젯에 고유한 heroTag를 추가하면 에러가 해결된다.