gpt4 book ai didi

对话框内的 Flutter webview

转载 作者:IT王子 更新时间:2023-10-29 07:22:32 24 4
gpt4 key购买 nike

Widget webview() {
return Container(
child: Padding(
padding: EdgeInsets.all(30.0),
child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
new GestureDetector(
child: Text(
'About',
style: TextStyle(fontSize: 16.0, color: const Color(0XFF5867DD)),
),
onTap: () {
openWebview();
},
),
],
),
));
}
Widget openWebview() {
return Container(
child: WebviewScaffold(
url: "https:www.google.com/",
withZoom: true,
withLocalStorage: true,
),
);
}
}

我正在我的 flutter 应用程序中创建 webview,问题是我想在单击 textview 时在对话框中打开 webview。

最佳答案

只需将它包裹在 MaterialPageRoute 中即可

  Widget openWebview() {
Navigator.of(context).push(new MaterialPageRoute<Null>(
builder: (BuildContext context) {
return Container(
child: WebviewScaffold(
url: "https:www.google.com/",
withZoom: true,
withLocalStorage: true,
),
);

},
fullscreenDialog: false
));
}

关于对话框内的 Flutter webview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54904055/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com