액티브 스킬/플러터

<Flutter> ListView 내 Stack 위젯의 child가 다음 ListViewItem에 가려질 때

디벅잉 2022. 7. 19. 22:51
728x90

 

🧭

 

어떤 경우에?

ListView 내 ListViewItem이 Stack 위젯을 가지고 Stack 위젯에 사용자 이벤트가 발생했을 때 숨겨둔 Positioned 위젯 등을 노출시킬 수 있습니다.

이 때 노출된 위젯의 높이가 부모 위젯의 높이를 초과하는 경우 다음번 나오는 ListViewItem에 가리게 됩니다.

높이를 초과하는 부분을 가리지 않고 그대로 드러내려면 어떻게 해야 할까요?

 

어떻게?

OverlayEntry, CompositedTransformFollower 등을 조합하여 이를 구현할 수 있습니다.

 

📌

 

https://blog.logrocket.com/complete-guide-implementing-overlays-flutter/

 

Implementing overlays in Flutter - LogRocket Blog

The Overlay in Flutter makes it easy to create visual elements on top of other widgets by adding them to the Overlay’s stack.

blog.logrocket.com

 

728x90