반응형
플러터로 안드로이드의 App Link, ios의 Universal Link를 사용해서
링크 접속시 앱을 여는 기능을 구현중인데,
기존에 PopScope를 이용해서 구현해둔 "뒤로가기 두번으로 종료" 기능이 안되는 현상을 발견했다.
분석해본 결과,
root 화면에서만 안되는것을 알 수 있었고,
인터넷 검색 결과, 13+ 버전의 GoRouter에서 발생하는 이슈였다.
https://github.com/flutter/flutter/issues/140869
[go_router] WillPopScope/PopScope doesn't trigger with back button navigation on root screens · Issue #140869 · flutter/flutte
Steps to reproduce Open the app Wrap screen with WillPopScope or PopScope Click hardware back button or use back gesture Expected results WillPopScope or PopScope callback is invoked Actual results...
github.com
pubspec.yaml의 go_router 패키지 버전을 12.1.3으로 다운시킴으로써 해결..!
반응형