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

WebView with back navigation transition doesn't work properly. #107

Open
czater opened this issue Jun 26, 2018 · 9 comments
Open

WebView with back navigation transition doesn't work properly. #107

czater opened this issue Jun 26, 2018 · 9 comments

Comments

@czater
Copy link

czater commented Jun 26, 2018

After pushing to WebView and then try to back (using iOS swipe), the transition doesn't work properly.

@czater
Copy link
Author

czater commented Jun 26, 2018

lol

Thats what I mean.

@anisalibegic
Copy link

I have the same problem. I think it's because you are using WebviewScaffold and WebviewScaffold is using rectangle to launch the Webview. With that said it can't dynamically change it's position when using back button, only close and dispose Webview when page is disposed. I override back button to close and dispose Webview and then close the page.

@lukepighetti
Copy link

Also running into this. It is a significant contributor to jank. Is there anything that can be done about it?

@NewITCorp
Copy link

I also had this

@lukepighetti
Copy link

Here is an example showing what appears to be the native web view coming on screen before the view has slid on. Would it be possible to add a property to the web view that is a delay before rendering? Would it be possible to put a Flutter widget that shows the last view of the web view so that it can be animated in and out of the viewport?

example

@harsha973
Copy link

Same issue for me :(

@saeedjassani
Copy link

Hello,

Any update on this?

@mertcanbs
Copy link

Same issue here.

A workaround for navigating back for me was to use a WillPopScope widget and close the plugin before popping the scope. I will be using this until this issue is addressed:

class WebviewTest extends StatelessWidget {
   final String url;

   const WebviewTest({@required this.url});

   @override
   Widget build(BuildContext context) {
      return WillPopScope(
         onWillPop: () async {
            FlutterWebviewPlugin().close(); // Close the plugin so that it doesn't overlay anymore
            return true;
         }
         child: WebviewScaffold(
            appBar: AppBar(
               title: Text("Webview"),
            ),
            url: url,
         ),
      );
   }
}

This will, however, show your "loader" widget briefly (if unassigned, a regular CircularProgressIndicator). To overcome that, you can assign an empty container to the initialChild value of WebviewScaffold in onWillPop (Of course that means you'd need a Stateful Widget instead)

@scaraux
Copy link

scaraux commented Jul 13, 2020

Same issue here.

A workaround for navigating back for me was to use a WillPopScope widget and close the plugin before popping the scope. I will be using this until this issue is addressed:

class WebviewTest extends StatelessWidget {
   final String url;

   const WebviewTest({@required this.url});

   @override
   Widget build(BuildContext context) {
      return WillPopScope(
         onWillPop: () async {
            FlutterWebviewPlugin().close(); // Close the plugin so that it doesn't overlay anymore
            return true;
         }
         child: WebviewScaffold(
            appBar: AppBar(
               title: Text("Webview"),
            ),
            url: url,
         ),
      );
   }
}

This will, however, show your "loader" widget briefly (if unassigned, a regular CircularProgressIndicator). To overcome that, you can assign an empty container to the initialChild value of WebviewScaffold in onWillPop (Of course that means you'd need a Stateful Widget instead)

This worked for me, however I had to make sure I am calling Navigator.maybePop(context) instead of pop(context)

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

No branches or pull requests

9 participants