Reputation: 35
in my application I need to open a webpage (ex. https://www.google.com/) in the application. With url_launcher opens the default browser eg safari or chrome. Instead, I would like to view the web page inside, without opening an external browser Can anyone help me?
Upvotes: 0
Views: 3141
Reputation: 107
Hi you can use the Webview package, I guess
import 'package:webview_flutter/webview_flutter.dart';
return Scaffold(
appBar: AppBar(
title: const Text('Flutter WebView example'),
),
body: const WebView(
initialUrl: 'https://flutter.io',
javascriptMode: JavascriptMode.unrestricted,
),
);
Source: https://pub.dev/packages/webview_flutter
Upvotes: 3
Reputation: 2678
You can force your url_launcher
plugin to open the page on web view by adding the optional parameter :
launch('website_name',forceWebView: true);
Upvotes: 0