how can i controll the default pop property of bottom sheet.Like I want to asign a value to a variable when showModalBottomSheet is popped .I have tried to do with controllers
how can i controll the default pop property of bottom sheet.Like I want to asign a value to a variable when showModalBottomSheet is popped .I have tried to do with controllers
5
Answers
thanks for your help
I solved the problem with WillPopScope
Why don’t you just do :
you can trigger when the bottom sheet is popped/dismissed with an
AnimationController
like this:in your
StatefulWidget
‘sState
:in your
showModalBottomSheet
:You can set
isDismissible: false,
and than add one button (Close button) on tap of button, you have to do your code and pop the bottomSheet.if you want to click on the
back button
,showModalBottomSheet
closed ,I suggest used
useRootNavigator: true
inshowModalBottomSheet