Nessuna descrizione

Honza Bittner 0d1898af4a Add comments, add previews to README 8 anni fa
android 30b269d5e5 Enable going back in history with backpress on Android if history is available; otherwise, destroy the webview activity. The user is still able to immediately leave the webview with the button present on the top left corner. 8 anni fa
example 0d1898af4a Add comments, add previews to README 8 anni fa
ios d06a18ca31 FIX: trigger onDestroy and hide topBar in fullScree mode 8 anni fa
lib 88ab2382b4 0.0.5 8 anni fa
.analysis_options f2b4436fa9 doc 8 anni fa
.gitignore 4e3488bc16 iOS web view plugin 8 anni fa
CHANGELOG.md 88ab2382b4 0.0.5 8 anni fa
LICENSE feb642eaf0 first commit 8 anni fa
README.md 0d1898af4a Add comments, add previews to README 8 anni fa
flutter_webview_plugin.iml feb642eaf0 first commit 8 anni fa
pubspec.yaml 88ab2382b4 0.0.5 8 anni fa

README.md

flutter_webview_plugin

Plugin that allow Flutter to communicate with a native WebView.

For Android, it will launch a new Activity inside the App with the Webview inside. Does not allow to integrate a Webview inside a Flutter Widget

For IOS, it will launch a new UIViewController inside the App with the UIWebView inside. Does not allow to integrate a Webview inside a Flutter Widget

  • Android
  • IOS

Getting Started

For help getting started with Flutter, view our online documentation.

How it works

Launch WebView with variable url

void launchWebView(String url) sync {
  var flutterWebviewPlugin = new FlutterWebviewPlugin();  
  
  flutterWebviewPlugin.launch(url);  
  
  // Wait in this async function until destroy of WebView.
  await flutterWebviewPlugin.onDestroy.first;
}

Close launched WebView

void launchWebViewAndCloseAfterWhile(String url) {
  var flutterWebviewPlugin = new FlutterWebviewPlugin();  
  
  flutterWebviewPlugin.launch(url);  
  
  // After 10 seconds.
  new Timer(const Duration(seconds: 10), () {
    // Close WebView.
    // This will also emit the onDestroy event.
    flutterWebviewPlugin.close();
  });
}

Android

Add the Activity to you AndroidManifest.xml:

<activity android:name="com.flutter_webview_plugin.WebviewActivity" android:parentActivityName=".MainActivity"/>

iOS

No extra configuration is needed.