Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to close Launcher web view in flutter/dart

Tags:

flutter

dart

My question is how to close the launcher view after creating it ?

 urlLauncher(String url) async {
      if (await canLaunch(url)) {
        await launch(url, forceWebView: true);
      } else {
        throw 'Could not launch $url';
      }
    }
like image 959
Saed Nabil Avatar asked Dec 20 '25 00:12

Saed Nabil


1 Answers

I found a solution for that This pull request adds the closeWebView method, so that the web view can be closed programmatically. To use the version of the pull request, use this in pubspec.yaml:

dependencies:
  url_launcher:
    git:
      url: git://github.com/flutter/plugins.git
      path: packages/url_launcher
      ref: 2c56dd4cca2f5b85619eaea425baccb1e0600886

check your indentations in the yaml files as it is very important..

like image 194
Saed Nabil Avatar answered Dec 22 '25 15:12

Saed Nabil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!