flutterdart

Is there any way to open an URL inside app instead of browser in flutter?


  1. URL_ LAUNCHER opens URL on a web browser

  2. But I want to show URL inside my app INSTEAD OF any browser

  3. How can I achieve this ?

  4. Whenever user click on a button url should launch inside my app instead of any default web browser or any type of browser


Solution

  • You can use this Flutter plugin https://pub.dartlang.org/packages/webview_flutter

    import 'package:webview_flutter/webview_flutter.dart';
    
        return Scaffold(
              appBar: AppBar(
                title: const Text('WebView example'),
              ),
              body: const WebView(
                initialUrl: 'SOME URL',
                javascriptMode: JavascriptMode.unrestricted,
              ),
            );