I have 4 menu in bottom navigation, and two of them is webview using inappwebview.
first webview is : https://google.com
second webview is : https://flutter.dev/
If I click first webview then I click second webview, the webview is not redirect to new url, and vice versa.
but if after click first webview then I click other menus that are not webview, then click second webview it's normal redirect to second webview
so how to redirect to new url when webviewpage is still active (not close using click other menu)
this my inappwebview
InAppWebView(
initialUrlRequest: URLRequest(url: Uri.parse(widget.url)),
onWebViewCreated: (
InAppWebViewController controller) async {
_webViewController = controller;
},
androidOnPermissionRequest: (controller, origin, resources) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT);
},
onProgressChanged: (InAppWebViewController controller,
int progress) {
setState(() {
this.progress = progress / 100;
});
},
)
this the bottom navigation
_children = [
HomePage(),
ProfilePage(),
MyWebview(url: web_inbox, statusAppbar: false, webMenu: web_menu_inbox,),
MyWebview(url: web_feedback, statusAppbar: false, webMenu: web_menu_feedback,),
]
BottomNavigationBar(
onTap: onTappedBar,
currentIndex: _current,
backgroundColor: Color(0xFF003c85),
selectedFontSize: 12,
unselectedFontSize: 12,
selectedItemColor: Color(0xFFf4931f),
unselectedItemColor: Color(0xFFc0bfbf),
type: BottomNavigationBarType.fixed,
items: [
BottomNavigationBarItem(
icon: Image.asset('asset/images/abba-home-pasif.png', height: 25, width: 25, fit: BoxFit.fill,),
activeIcon: Image.asset('asset/images/abba-home-aktif.png', height: 25, width: 25, fit: BoxFit.fill,),
label: "Home"
),
BottomNavigationBarItem(
icon: Image.asset('asset/images/profile-pasif.png', height: 25, width: 25, fit: BoxFit.fill,),
activeIcon: Image.asset('asset/images/profile-aktif.png', height: 25, width: 25, fit: BoxFit.fill,),
label: "Profile"
),
BottomNavigationBarItem(
icon: Image.asset('asset/images/inbox-pasif.png', height: 25, width: 32, fit: BoxFit.fill,),
activeIcon: Image.asset('asset/images/inbox-aktif.png', height: 25, width: 32, fit: BoxFit.fill,),
label: "Inbox"
),
BottomNavigationBarItem(
icon: Image.asset('asset/images/comment-pasif.png', height: 27, width: 30, fit: BoxFit.fill,),
activeIcon: Image.asset('asset/images/comment-aktif.png', height: 27, width: 30, fit: BoxFit.fill,),
label: "Feedback"
)
],
)
void onTappedBar(int index){
setState((){
_current = index;
});
}