flutter - 在 Bubblebottombar 颤振上创建 webview 链接
问题描述
感谢您的帮助,我正在尝试在我的应用程序菜单中创建一个链接,该链接将通过 webview 打开我的 YouTube 频道,有人能告诉我这怎么可能吗?非常感谢
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Center(
child: getView(currentPage),
),
),
bottomNavigationBar: BubbleBottomBar(
opacity: .2,
currentIndex: currentPage,
backgroundColor: appStore.appBarColor,
elevation: 8,
onTap: changePage,
hasNotch: false,
hasInk: true,
inkColor: appStore.appColorPrimaryLightColor,
items: <BubbleBottomBarItem>[
tab("home-run.png", keyString(context, "title_bookStore")),
tab(
"librarysolid.png",
isLoginIn
? keyString(context, "title_myLibrary")
: keyString(context, "lbl_categories")),
tab("search.png", keyString(context, "title_search")),
tab("user.png", keyString(context, "title_account")),
],
),
);
}
解决方案
Widget build(BuildContext context) {
return Directionality(
textDirection: TextDirection.ltr,
child: Stack(
children: <Widget>[
WebView(
initialUrl: this.url,
javascriptMode: JavascriptMode.unrestricted,
onPageFinished: (finish) {
setState(() {
isLoading = false;
});
},
),
isLoading
? Center(
child: CircularProgressIndicator(),
)
: Stack(),
],
),
);
}
您可以使用 Stack 将其放置在您需要的任何位置
推荐阅读
- .net-core - Maxmind 将新的 DatabaseReader 作为单调注入,以避免一次又一次地重新访问文件
- c# - 如何在 EmguCV 中设置相机的属性
- android - 如何为同一目的地注册多个 PendingIntent?
- ruby-on-rails - 在 Rails 表单中,如何添加多选下拉菜单?
- python - 如何使用从 C++ 发送的地址在 python 中获取值?
- java - BigDecimal 除法抛出 ArithmeticException:除以零,即使我检查它
- python - 如何在 python 中从 OrderedDict 获取密钥
- r - 即使在应用“app_init_timeout 300;”之后,闪亮的应用程序也无法加载 到闪亮的配置
- sftp - 使用 WinSCP 命令行参数覆盖日志文件
- java - 在分层架构 Spring Boot 中放置外部 API 调用的位置