Prevent Dialog from Hardware back button
prasantco opened this issue · 1 comments
I am passing this value(false) to the barrierDismissible but its functionality is not working properly.We want to prevent/stop the dismissable of dialog from external hardware back button.
YYDialog YYNoticeDialog() {
return YYDialog().build()
..width = 120
..height = 110
..backgroundColor = Colors.black.withOpacity(0.8)
..barrierDismissible = false
..borderRadius = 10.0
..showCallBack = () {
print("showCallBack invoke");
}
..dismissCallBack = () {
print("dismissCallBack invoke");
}
..widget(Padding(
padding: EdgeInsets.only(top: 21),
child: Image.asset(
'images/success.png',
width: 38,
height: 38,
),
))
..widget(Padding(
padding: EdgeInsets.only(top: 10),
child: Text(
"Success",
style: TextStyle(
fontSize: 15,
color: Colors.white,
),
),
))
..animatedFunc = (child, animation) {
return ScaleTransition(
child: child,
scale: Tween(begin: 0.0, end: 1.0).animate(animation),
);
}
..show();
}
you can add WillPopScope
like this:
..widget(
WillPopScope(
onWillPop: () {
return Future.value(false);
},
child: your widget
)
)