본문 바로가기

navigation2

Flutter 플러터에서 모달 바텀 시트를 프로그래밍 방식으로 닫는 방법, Close modal bottom sheet programmatically in flutter 질문 저는 showModalBottomSheet()를 통해 BottomSheet를 표시하고 여러 위젯과 GestureDetector 내부에서 작동합니다. BottomSheet를 바깥쪽을 터치하여 닫는 것뿐만 아니라, GestureDetector 내부의 onTap 이벤트 후에도 닫히기를 원합니다. 그러나 GestureDetector가 터치 이벤트를 전달하지 않는 것 같습니다. 그래서 ModalBottomSheet를 프로그래밍 방식으로 닫거나 GestureDetector가 터치 이벤트를 전달하도록 지시하는 방법이 있는지 궁금합니다. 업데이트 (2018-04-12): 더 잘 이해하기 위해 코드 스니펫을 따릅니다. "아이템 1" 또는 "아이템 2"를 탭할 때 ModalBottomSheet가 닫히지 않는 문제가 .. 2023. 5. 31.
flutter 하위 트리 내에서 동일한 태그를 공유하는 여러 영웅이 있습니다., There are multiple heroes that share the same tag within a subtree 질문 저는 라우트를 사용하여 한 화면에서 다른 화면으로 이동하려고 합니다. 페이지를 이동시키기 위한 버튼을 누르면 다음과 같은 오류가 발생합니다. I/flutter ( 8790): Another exception was thrown: There are multiple heroes that share the same tag within a subtree. 다음은 코드입니다: 라우트: { '/first':(BuildContext context) =>NavigatorOne() , '/second':(BuildContext context) =>NavigatorTwo(), '/third':(BuildContext context) =>NavigatorThree(), }, Navigator.of(context).pu.. 2023. 5. 9.