return WillPopScope(
onwillPop: () async{
},
child: Scaffold(
body: SafeArea(
child: Obx(
() => IndexedStack(
index: logic.currentIndex.value,
children: logic.pages,
),
),
but the willpopscope is depreciated as per dart 3.2.3 version.what to do?
want to close the app only after double tap the back button with the popscope widget ?
2
Answers
Swap out the outdated WillPopScope widget for the PopScope new widget; see the code below
Yes Will PopScope is deprecated and you should use popScope instead.
This is a new widget provided by flutter to handle pop scope. Simply add this to any child and implement onPopInvoked method it will give you a Boolean value which gives you feedback on whether it popped or not if yes then pop scope was invoked and you can handle action accordingly.