5 4 月 2026, 周日

Flutter:Dialog弹窗设置点击空白处不关闭弹窗

   showDialog(context: context,
      barrierDismissible: false,//设置为false,点击空白处弹窗不关闭
      builder: (context){
        return new AlertDialog(
          content: Text('msg'),
          actions: <Widget>[
            new TextButton(
              child: new Text('确定'),
              onPressed: () {
                Navigator.of(context).pop();
              },
            ),
          ],
        );
      },
    );
Avatar photo

sion932