Giter Club home page Giter Club logo

Comments (4)

preeti-17 avatar preeti-17 commented on August 24, 2024 1

I have found a work around for this issue of drawer get hidden behind WebviewScaffold.
Under this solution whenever I click on the drawer in appbar to open, I hide the webview reference. You can follow below steps

  1. make a new file named "mywebview.dart"
  2. copy the entire file "webview_scaffold.dart" and paste in mywebview.dart and modify name of the Classes to "MyWebScaffold" as you can't use "WebViewScaffold".
  3. Now in your code instead of using class "WebviewScaffold" use your class that you have made "MyWebScaffold"
  4. Now it is the time to use stream listeners to get to know when the drawer is open or close. Add some string eg. "open" to listener on init() method of your Drawer class and do the same in dispose() method of Drawer class, eg. "close"
  5. As soon as listener listen "open", you need to call this method "webviewReference.hide();" and in case of "close" call "webviewReference.show();". All these you need to do inside a listener in init() method of your MyWebScaffold class.

This way Drawer will never get hide behind webviewscaffold and your webview always keeps its state with it, even after drawer gets open.

from flutter_webview_plugin.

lejard-h avatar lejard-h commented on August 24, 2024

Hi,
Sorry but there is no clean way to do that,

The webview is not a "Flutter Widget", it is a native view on top of the flutter view, so you can draw flutter widgets on it (drawer or popup menu).

The only thing you could do, is to call resize function when drawer is showing, or I could introduce an other function to completely hide the webview but the animation won't look clean and shiny.

That kind of feature is not possible due to Flutter, they are working on draw webview directly on the widget tree, I suggest you to follow this thread. (flutter/flutter#730)

from flutter_webview_plugin.

wolfkang avatar wolfkang commented on August 24, 2024

@lejard-h Thanks a lot.

from flutter_webview_plugin.

rakeshkhoodeeram avatar rakeshkhoodeeram commented on August 24, 2024

Hello,
I tried to launch the url within a rectangle.

flutterWebviewPlugin.launch(selectedUrl,
          rect: rect,
          userAgent: kAndroidUserAgent);

Now when the keyboard appears, I resize the rectangle

 @override
  void didChangeMetrics(){
    double width = MediaQuery.of(context).size.width;
    double height = MediaQuery.of(context).size.height-MediaQuery.of(context).viewInsets.bottom;
    rect = new Rect.fromLTWH(0.0, 0.0, width, height);
    flutterWebviewPlugin.resize(rect);
  }

The rectangle is not resizing correctly to display the url.

from flutter_webview_plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.