Giter Site home page Giter Site logo

codehole7 / flutter_inappwebview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pichillilorenzo/flutter_inappwebview

1.0 0.0 0.0 3.58 MB

A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.

Home Page: https://pub.dartlang.org/packages/flutter_inappwebview

License: Apache License 2.0

Java 25.42% Ruby 0.16% Swift 20.75% Objective-C 0.12% Dart 47.79% CSS 0.22% HTML 5.15% Shell 0.13% JavaScript 0.26%

flutter_inappwebview's Introduction

Flutter InAppWebView Plugin v5.3.2 Share on Twitter Share on Facebook

Pub pub points popularity likes Awesome Flutter License

Donate to this project GitHub contributors GitHub forks GitHub stars

InAppWebView-logo

A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.

Articles/Resources

Showcase - Who use it

Check the Showcase page to see an open list of Apps built with Flutter and Flutter InAppWebView.

Are you using the Flutter InAppWebView plugin and would you like to add your App there?

Send a submission request to the Submit App page!

Requirements

  • Dart sdk: ">=2.12.0-0 <3.0.0"
  • Flutter: ">=1.22.2"
  • Android: minSdkVersion 17 and add support for androidx (see AndroidX Migration to migrate an existing app)
  • iOS: --ios-language swift, Xcode version >= 12

Installation

Add flutter_inappwebview as a dependency in your pubspec.yaml file.

Main Classes Overview

  • InAppWebView: Flutter Widget for adding an inline native WebView integrated into the flutter widget tree.
  • ContextMenu: This class represents the WebView context menu.
  • HeadlessInAppWebView: Class that represents a WebView in headless mode. It can be used to run a WebView in background without attaching an InAppWebView to the widget tree.
  • InAppBrowser: In-App Browser using native WebView.
  • ChromeSafariBrowser: In-App Browser using Chrome Custom Tabs on Android / SFSafariViewController on iOS.
  • InAppLocalhostServer: This class allows you to create a simple server on http://localhost:[port]/. The default port value is 8080.
  • CookieManager: This class implements a singleton object (shared instance) which manages the cookies used by WebView instances.
  • HttpAuthCredentialDatabase: This class implements a singleton object (shared instance) that manages the shared HTTP auth credentials cache.
  • WebStorageManager: This class implements a singleton object (shared instance) which manages the web storage used by WebView instances.

Support

Did you find this plugin useful? Please consider to make a donation to help improve it!

Edit guide for persistent http header

To add persistent http header, you should use shouldOverrideUrlLoading() method that flutter_inappwebview package provide. they returns navigationAction as second parameter that contains request that are going to be proceeded. In this case, it contains method, header, url and all other options but it doesn't included body of request. This is what original package did in swift code. Thus, you need to change it so that it returns body of request. To do this, you need to change one file ./ios/Classes/Types/URLRequest.swift add this line "body": httpBody, after line65 then it will looks like this.

    public func toMap () -> [String:Any?] {
        var iosAllowsConstrainedNetworkAccess: Bool? = nil
        var iosAllowsExpensiveNetworkAccess: Bool? = nil
        if #available(iOS 13.0, *) {
            iosAllowsConstrainedNetworkAccess = allowsConstrainedNetworkAccess
            iosAllowsExpensiveNetworkAccess = allowsExpensiveNetworkAccess
        }
        return [
            "url": url?.absoluteString,
            "method": httpMethod,
            "headers": allHTTPHeaderFields,
            "body": httpBody,
            "iosAllowsCellularAccess": allowsCellularAccess,
            "iosAllowsConstrainedNetworkAccess": iosAllowsConstrainedNetworkAccess,
            "iosAllowsExpensiveNetworkAccess": iosAllowsExpensiveNetworkAccess,
            "iosCachePolicy": cachePolicy.rawValue,
            "iosHttpShouldHandleCookies": httpShouldHandleCookies,
            "iosHttpShouldUsePipelining": httpShouldUsePipelining,
            "iosNetworkServiceType": networkServiceType.rawValue,
            "iosTimeoutInterval": timeoutInterval,
            "iosMainDocumentURL": mainDocumentURL?.absoluteString
        ]
    }

Then you can get body of request with navigationAction.request.body And you can make same request with same params and can add custom headers to the request. thats all.

use this package in your flutter project

in pubspec.yaml file, add this under dependencies

flutter_inappwebview:
    git:
      url: https://github.com/galaxydeve/flutter_inappwebview.git
      ref: master 

flutter_inappwebview's People

Contributors

aakira avatar alexv525 avatar andreidiaconu avatar benmeemo avatar cinos1 avatar codehole7 avatar crazecoder avatar deandreamatias avatar doflatango avatar eddayy avatar fattiger00 avatar igtm avatar juicycleff avatar klydra avatar matthewlloyd avatar panndoraboo avatar paulodurrermelo avatar phamnhuvu-dev avatar pichillilorenzo avatar plateaukao avatar robsonmeemo avatar ryanhz avatar sebastienbtr avatar sense545 avatar tneotia avatar wwwdata avatar youcii avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.