Skip to content

Commit 074a820

Browse files
mvanbeusekomBeMacized
authored andcommitted
[webview_flutter] Extract WKWebView implementation into a separate package (flutter#4345)
* Setup webview_flutter_wkwebview package. Creates a new `webview_flutter_wkwebview` directory and adds the following meta-data files: - `AUTHORS`: copied from the `webview_flutter` package and added my name; - `CHANGELOG.md`: new file adding description for release 0.0.1; - `LICENSE`: copied from the `webview_flutter` package; - `README.md`: new file adding the standard platform implementation description; - `pubspec.yaml`: new file adding package meta-data for the `webview_flutter_wkwebview` package. * Direct copy of "iOS" folder. A one to one copy of the `webview_flutter/ios` folder to `webview_flutter_wkwebview/` using the following command: ``` cp -R ./webview_flutter/ios ./webview_flutter_wkwebview/ ``` * Rename .podspec file to match package name. For the Cocaopod package to be registered correctly the .podspec file name needs to match the name of the Flutter package. * Direct copy of WKWebView specific .dart files. Copied the WKWebView specific .dart files over from the `./webview_flutter` package. * Modify .dart code to work with new platform_interface. Make sure the `CupertinoWebView` widget extends the `WebViewPlatform` class from the `webview_flutter_platform_interface` package correctly by accepting an instance of the `JavascriptChannelRegistry` class. * Direct copy of the `webview_flutter/example` app. This commit makes a direct copy of the `webview_flutter/example` app to the `webview_flutter_wkwebview` package. After the copy the `example/android` folder is removed as it doesn't serve a purpose in the WKWebView specific package. Commands run where: ``` cp -R ./webview_flutter/example ./webview_flutter_wkwebview/ rm -rf ./webview_flutter_wkwebview/example/ios ``` * Update example to WKWebView specific implementation. This commit updates the example App so it directly implements the WKWebView specific implementation of the webview_flutter_platform_interface. * Update integration tests. Updated the existing integration tests (copied from webview_flutter package) so they work correctly with the implementation of the webview_flutter_wkwebview package. Co-authored-by: BeMacized <bodhimulders@bemacized.net> * Fix iOS UI tests. This commit resolves failing UI tests and ensures the `Publishable` task is green. * Point to existing documentation URL Update the documentation URL in the `ios/webview_flutter_wkwebview.podspec` file to point to a valid location. The `https://pub.dev/packages/webview_flutter_wkwebview` package doesn't exists until this PR is published. However the `pod lib lint` step in CI is failing if the URL doesn't exist yet. * Split helper classes from main example widget. Move the `WebView` and related `WebViewController` classes from the main.dart into a separate web_view.dart file. * Updated version numbers as suggested in review. Updated the version of the plugin to the version of webview_flutter package (2.0.13). Also updated the Dart and Flutter versions to respectively 2.14.0 and 2.5.0. Co-authored-by: BeMacized <bodhimulders@bemacized.net>
1 parent e18cc77 commit 074a820

File tree

73 files changed

+4814
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4814
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Below is a list of people and organizations that have contributed
2+
# to the Flutter project. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Google Inc.
7+
The Chromium Authors
8+
German Saprykin <saprykin.h@gmail.com>
9+
Benjamin Sauer <sauer.benjamin@gmail.com>
10+
larsenthomasj@gmail.com
11+
Ali Bitek <alibitek@protonmail.ch>
12+
Pol Batlló <pol.batllo@gmail.com>
13+
Anatoly Pulyaevskiy
14+
Hayden Flinner <haydenflinner@gmail.com>
15+
Stefano Rodriguez <hlsroddy@gmail.com>
16+
Salvatore Giordano <salvatoregiordanoo@gmail.com>
17+
Brian Armstrong <brian@flutter.institute>
18+
Paul DeMarco <paulmdemarco@gmail.com>
19+
Fabricio Nogueira <feufeu@gmail.com>
20+
Simon Lightfoot <simon@devangels.london>
21+
Ashton Thomas <ashton@acrinta.com>
22+
Thomas Danner <thmsdnnr@gmail.com>
23+
Diego Velásquez <diego.velasquez.lopez@gmail.com>
24+
Hajime Nakamura <nkmrhj@gmail.com>
25+
Tuyển Vũ Xuân <netsoft1985@gmail.com>
26+
Miguel Ruivo <miguel@miguelruivo.com>
27+
Sarthak Verma <sarthak@artiosys.com>
28+
Mike Diarmid <mike@invertase.io>
29+
Invertase <oss@invertase.io>
30+
Elliot Hesp <elliot@invertase.io>
31+
Vince Varga <vince.varga@smaho.com>
32+
Aawaz Gyawali <awazgyawali@gmail.com>
33+
EUI Limited <ian.evans3@admiralgroup.co.uk>
34+
Katarina Sheremet <katarina@sheremet.ch>
35+
Thomas Stockx <thomas@stockxit.com>
36+
Sarbagya Dhaubanjar <sarbagyastha@gmail.com>
37+
Ozkan Eksi <ozeksi@gmail.com>
38+
Rishab Nayak <rishab@bu.edu>
39+
ko2ic <ko2ic.dev@gmail.com>
40+
Jonathan Younger <jonathan@daikini.com>
41+
Jose Sanchez <josesm82@gmail.com>
42+
Debkanchan Samadder <debu.samadder@gmail.com>
43+
Audrius Karosevicius <audrius.karosevicius@gmail.com>
44+
Lukasz Piliszczuk <lukasz@intheloup.io>
45+
SoundReply Solutions GmbH <ch@soundreply.com>
46+
Rafal Wachol <rwachol@gmail.com>
47+
Pau Picas <pau.picas@gmail.com>
48+
Christian Weder <chrstian.weder@yapeal.ch>
49+
Alexandru Tuca <salexandru.tuca@outlook.com>
50+
Christian Weder <chrstian.weder@yapeal.ch>
51+
Rhodes Davis Jr. <rody.davis.jr@gmail.com>
52+
Luigi Agosti <luigi@tengio.com>
53+
Quentin Le Guennec <quentin@tengio.com>
54+
Koushik Ravikumar <koushik@tengio.com>
55+
Nissim Dsilva <nissim@tengio.com>
56+
Giancarlo Rocha <giancarloiff@gmail.com>
57+
Ryo Miyake <ryo@miyake.id>
58+
Théo Champion <contact.theochampion@gmail.com>
59+
Kazuki Yamaguchi <y.kazuki0614n@gmail.com>
60+
Eitan Schwartz <eshvartz@gmail.com>
61+
Chris Rutkowski <chrisrutkowski89@gmail.com>
62+
Juan Alvarez <juan.alvarez@resideo.com>
63+
Aleksandr Yurkovskiy <sanekyy@gmail.com>
64+
Anton Borries <mail@antonborri.es>
65+
Alex Li <google@alexv525.com>
66+
Rahul Raj <64.rahulraj@gmail.com>
67+
Maurits van Beusekom <maurits@baseflow.com>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 2.0.13
2+
3+
* Extract WKWebView implementation from `webview_flutter`.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Copyright 2013 The Flutter Authors. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above
9+
copyright notice, this list of conditions and the following
10+
disclaimer in the documentation and/or other materials provided
11+
with the distribution.
12+
* Neither the name of Google Inc. nor the names of its
13+
contributors may be used to endorse or promote products derived
14+
from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# webview\_flutter\_wkwebview
2+
3+
The Apple WKWebView implementation of [`webview_flutter`][1].
4+
5+
## Usage
6+
7+
This package is [endorsed][2], which means you can simply use `webview_flutter`
8+
normally. This package will be automatically included in your app when you do.
9+
10+
[1]: https://pub.dev/packages/webview_flutter
11+
[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 1e5cb2d87f8542f9fbbd0f22d528823274be0acb
8+
channel: master
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# webview_flutter_example
2+
3+
Demonstrates how to use the webview_flutter plugin.
4+
5+
## Getting Started
6+
7+
For help getting started with Flutter, view our online
8+
[documentation](https://flutter.dev/).
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)