1

I have a requirement to open the in app web browser in flutter and for that I used the plugin url_launcher (https://pub.dev/packages/url_launcher). After the integration in iOS it opens up the inapp browser as expected with a closable option. However in Android, it opens up the browser in full screen mode where I cannot able to close the web browser, unless I press the system back button.

Any idea how I can achieve this requirement to have a close button? or do I need to do any setting to enable the soft back/close button for android?

This is the view in iOS with closable options.

enter image description here

This is the view in Android. Please see the source code below on how I am opening the browser.

enter image description here

launchUrl(Uri.parse("https://stackoverflow.com/"),
              mode: LaunchMode.inAppWebView);
Selvarathinam Vinoch
  • 1,080
  • 3
  • 13
  • 23

1 Answers1

0

You can use the LaunchMode.externalApplication parameter.

await launchUrl(_url, mode: LaunchMode.externalApplication);
Luki L
  • 93
  • 1
  • 1
  • 7
  • Hi @Luki, I do not want to open the external browser. My requirement is to open the in-app browser with a closable button/option. I worked with Xamarin and it opens the in-app browser with a 'X' on the top right corner in all android devices, but flutter in-app browser does not have that option it seems. I am still not sure whether this is an issue with the plugin or flutter. – Selvarathinam Vinoch Jun 13 '23 at 13:44