【发布时间】:2021-11-21 11:57:39
【问题描述】:
override
Widget build(BuildContext context) {
return WillPopScope(
child: Scaffold(
backgroundColor: Colors.white,
bottomNavigationBar: _bottomTab(),
appBar: AppBar(
title: Text('View ' + type),
),
body: Stack(
children: [
Container(
child: WebviewScaffold(
url: weburl,
displayZoomControls: true,
withJavascript: true,
scrollBar: true,
withZoom: true,
hidden: true,
),
),
Visibility(
visible: _isLoading,
child: Align(
alignment: Alignment.center,
child: CircularProgressIndicator(),
))
],
)),
onWillPop: backPress);
}
Widget _bottomTab() {
return BottomNavigationBar(
backgroundColor: Colors.grey,
items: [
BottomNavigationBarItem(
icon: Icon(Icons.contact_page), label: "Dashboard"),
BottomNavigationBarItem(icon: Icon(Icons.call), label: "Call"),
BottomNavigationBarItem(
icon: Icon(Icons.download_rounded), label: "Download"),
BottomNavigationBarItem(icon: Icon(Icons.share), label: "Share"),
],
type: BottomNavigationBarType.shifting,
selectedItemColor: Colors.black,
unselectedItemColor: Colors.grey,
onTap: _onItemTapped,
);
}
void _onItemTapped(int index) {
switch (index) {
case 0:
break;
case 1:
_makingPhoneCall();
break;
case 2:
setState(() {
_isLoading = true;
getPermission('download');
});
break;
case 3:
setState(() {
_isLoading = true;
getPermission('share');
});
break;
}
}
每当我单击底部导航时,我都有一个带有底部导航的 webview 我想在 webview 的中心显示进度指示器。我尝试了带有按钮和 progressindicator 的堆栈小部件,但是当我尝试使用 webview 显示进度指示器时什么都不显示
注意: 单击底部导航时在 webview 的中心显示进度指示器
提前致谢!
【问题讨论】: