flutter: dialog: Change barrierDismissible from false to true

If barrierDismissible is true, then tapping this barrier will cause
the current route to be popped (see Navigator.pop) with null as the value.
This commit is contained in:
Calcitem 2021-04-11 20:16:00 +08:00
parent 1dbdfe679a
commit db81c3c2fe
2 changed files with 5 additions and 5 deletions

View File

@ -163,7 +163,7 @@ class _AboutPageState extends State<AboutPage> {
_showVersionInfo() {
showDialog(
context: context,
barrierDismissible: false,
barrierDismissible: true,
builder: (context) => alertDialog(context),
);
}

View File

@ -434,7 +434,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
if (result == GameResult.win) {
showDialog(
context: context,
barrierDismissible: false,
barrierDismissible: true,
builder: (BuildContext context) {
return AlertDialog(
title: Text(dialogTitle,
@ -461,7 +461,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
} else {
showDialog(
context: context,
barrierDismissible: false,
barrierDismissible: true,
builder: (BuildContext context) {
return AlertDialog(
title: Text(dialogTitle,
@ -685,7 +685,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
),
onPressed: () => showDialog(
context: context,
barrierDismissible: false,
barrierDismissible: true,
builder: (BuildContext context) {
return AlertDialog(
backgroundColor: AppTheme.moveHistoryDialogBackgroundColor,
@ -728,7 +728,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
),
onPressed: () => showDialog(
context: context,
barrierDismissible: false,
barrierDismissible: true,
builder: (BuildContext context) {
return AlertDialog(
backgroundColor: AppTheme.hintDialogackgroundColor,