Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bottom tabBar control webView #458

Closed
CocoaZX opened this issue Jun 27, 2019 · 8 comments
Closed

Bottom tabBar control webView #458

CocoaZX opened this issue Jun 27, 2019 · 8 comments

Comments

@CocoaZX
Copy link

CocoaZX commented Jun 27, 2019

System info

Issue occurs on: / both
Plugin version: newest
Flutter doctor output:

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.1)
[✓] iOS tools - develop for iOS devices
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.35.1)
[✓] Connected device (5 available)

Steps to Reproduce

I have a webView in bottom page 1, when I change bottomBar, the flutter page well change, but webView aways stay top. How can I hidden it, or can webView under the flutter control?

Logs

@joelbrostrom
Copy link

I came to ask the exact same question!

I'm trying to push a login screen over the WebviewScaffold, thus removing the navigation bar and everything else.

I have tried a few different approaches. Using MaterialRouting, Named MaterialRouting and building a WebviewScaffold and passing it to a normal Scaffold body (see example below)

The first two would be preferable since they push the new login screen over the BottomNavigationBar but there are problems:

  1. The WebviewScaffold always stays on top no mater how many screens are pushed on top of it.
  2. Manually hiding the WebView with flutterWebViewPlugin.hide works, but I cant find a way to show it again after the login screen pops.

The third alternative of creating a list of widgets ([webView, loginScreen, otherTabs]) and then building the body of the current tab index hides the WebView but the tab bar is still showing.

List<Widget> bodyList = [webView, loginScreen, otherTabs];

Scaffold(
            appBar: AppBar(),
            bottomNavigationBar: BottomNavigationBar(
              onTap:(index){
                setState({
                  _currentIndex = index;
                })
             })
            body: bodyList[_currentIndex]
        )

How can I push a new screen on top of a WebView without it showing through?

@CocoaZX
Copy link
Author

CocoaZX commented Jun 28, 2019

@CocoaZX
Copy link
Author

CocoaZX commented Jun 28, 2019

@joelbrostrom just change to this webview

@joelbrostrom
Copy link

@CocoaZX I need keyboard support in the app.
If I understand it correctly inappbrowser does not show the keyboard when focusing text fields, which limits the usability substantially.
The same was true for flutter_webview.

@CocoaZX
Copy link
Author

CocoaZX commented Jul 8, 2019

@joelbrostrom Do you fix keyboard issue? I try many webview flutter, not found perfect one.

@joelbrostrom
Copy link

@CocoaZX No, My conclusion is that flutter is not optimal for WebView applications.
That being said, I have a project in production for a customer and the app relies on text input (search).
Therefor I had to go with flutter_webview_plugin which works, but require some workarounds.

@joelbrostrom
Copy link

@CocoaZX Woops, I realize now that I thought I was in a different forum.
The answer is that you have to hide your WebView using myWebView.hide whenever you want to display something "over" it and then return it using myWebView.show when you're done :)

@CocoaZX
Copy link
Author

CocoaZX commented Jul 12, 2019

OK,I know. It's strange way to solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants