Skip to content

Commit 75ede70

Browse files
[webview_flutter] Fix typos in tests and documentation (#3572)
[webview_flutter] Fix typos in tests and documentation
1 parent 4914c64 commit 75ede70

26 files changed

Lines changed: 67 additions & 63 deletions

packages/webview_flutter/webview_flutter/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## NEXT
22

33
* Updates minimum Flutter version to 3.3.
4+
* Fixes common typos in tests and documentation.
45

56
## 4.0.7
67

packages/webview_flutter/webview_flutter/lib/src/legacy/webview.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class WebView extends StatefulWidget {
142142
/// Which gestures should be consumed by the web view.
143143
///
144144
/// It is possible for other gesture recognizers to be competing with the web view on pointer
145-
/// events, e.g if the web view is inside a [ListView] the [ListView] will want to handle
145+
/// events, e.g. if the web view is inside a [ListView] the [ListView] will want to handle
146146
/// vertical drags. The web view will claim gestures that are recognized by any of the
147147
/// recognizers on this list.
148148
///
@@ -180,7 +180,7 @@ class WebView extends StatefulWidget {
180180
///
181181
/// To asynchronously invoke the message handler which will print the message to standard output.
182182
///
183-
/// Adding a new JavaScript channel only takes affect after the next page is loaded.
183+
/// Adding a new JavaScript channel only takes effect after the next page is loaded.
184184
///
185185
/// Set values must not be null. A [JavascriptChannel.name] cannot be the same for multiple
186186
/// channels in the list.

packages/webview_flutter/webview_flutter/lib/src/webview_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class WebViewController {
247247
/// to asynchronously invoke the message handler which will print the message
248248
/// to standard output.
249249
///
250-
/// Adding a new JavaScript channel only takes affect after the next page is
250+
/// Adding a new JavaScript channel only takes effect after the next page is
251251
/// loaded.
252252
///
253253
/// A channel [name] cannot be the same for multiple channels.

packages/webview_flutter/webview_flutter/lib/src/webview_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class WebViewWidget extends StatelessWidget {
105105
/// Specifies which gestures should be consumed by the web view.
106106
///
107107
/// It is possible for other gesture recognizers to be competing with the web
108-
/// view on pointer events, e.g if the web view is inside a [ListView] the
108+
/// view on pointer events, e.g. if the web view is inside a [ListView] the
109109
/// [ListView] will want to handle vertical drags. The web view will claim
110110
/// gestures that are recognized by any of the recognizers on this list.
111111
///

packages/webview_flutter/webview_flutter_android/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## NEXT
22

33
* Bumps androidx.webkit:webkit from 1.6.0 to 1.6.1.
4+
* Fixes common typos in tests and documentation.
45

56
## 3.4.5
67

packages/webview_flutter/webview_flutter_android/lib/src/android_webview_api_impls.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ class JavaScriptChannelFlutterApiImpl extends JavaScriptChannelFlutterApi {
563563
.getInstanceWithWeakReference(instanceId) as JavaScriptChannel?;
564564
assert(
565565
instance != null,
566-
'InstanceManager does not contain an JavaScriptChannel with instanceId: $instanceId',
566+
'InstanceManager does not contain a JavaScriptChannel with instanceId: $instanceId',
567567
);
568568
instance!.postMessage(message);
569569
}
@@ -617,11 +617,11 @@ class WebViewClientFlutterApiImpl extends WebViewClientFlutterApi {
617617
.getInstanceWithWeakReference(webViewInstanceId) as WebView?;
618618
assert(
619619
instance != null,
620-
'InstanceManager does not contain an WebViewClient with instanceId: $instanceId',
620+
'InstanceManager does not contain a WebViewClient with instanceId: $instanceId',
621621
);
622622
assert(
623623
webViewInstance != null,
624-
'InstanceManager does not contain an WebView with instanceId: $webViewInstanceId',
624+
'InstanceManager does not contain a WebView with instanceId: $webViewInstanceId',
625625
);
626626
if (instance!.onPageFinished != null) {
627627
instance.onPageFinished!(webViewInstance!, url);
@@ -636,11 +636,11 @@ class WebViewClientFlutterApiImpl extends WebViewClientFlutterApi {
636636
.getInstanceWithWeakReference(webViewInstanceId) as WebView?;
637637
assert(
638638
instance != null,
639-
'InstanceManager does not contain an WebViewClient with instanceId: $instanceId',
639+
'InstanceManager does not contain a WebViewClient with instanceId: $instanceId',
640640
);
641641
assert(
642642
webViewInstance != null,
643-
'InstanceManager does not contain an WebView with instanceId: $webViewInstanceId',
643+
'InstanceManager does not contain a WebView with instanceId: $webViewInstanceId',
644644
);
645645
if (instance!.onPageStarted != null) {
646646
instance.onPageStarted!(webViewInstance!, url);
@@ -661,11 +661,11 @@ class WebViewClientFlutterApiImpl extends WebViewClientFlutterApi {
661661
.getInstanceWithWeakReference(webViewInstanceId) as WebView?;
662662
assert(
663663
instance != null,
664-
'InstanceManager does not contain an WebViewClient with instanceId: $instanceId',
664+
'InstanceManager does not contain a WebViewClient with instanceId: $instanceId',
665665
);
666666
assert(
667667
webViewInstance != null,
668-
'InstanceManager does not contain an WebView with instanceId: $webViewInstanceId',
668+
'InstanceManager does not contain a WebView with instanceId: $webViewInstanceId',
669669
);
670670
// ignore: deprecated_member_use_from_same_package
671671
if (instance!.onReceivedError != null) {
@@ -691,11 +691,11 @@ class WebViewClientFlutterApiImpl extends WebViewClientFlutterApi {
691691
.getInstanceWithWeakReference(webViewInstanceId) as WebView?;
692692
assert(
693693
instance != null,
694-
'InstanceManager does not contain an WebViewClient with instanceId: $instanceId',
694+
'InstanceManager does not contain a WebViewClient with instanceId: $instanceId',
695695
);
696696
assert(
697697
webViewInstance != null,
698-
'InstanceManager does not contain an WebView with instanceId: $webViewInstanceId',
698+
'InstanceManager does not contain a WebView with instanceId: $webViewInstanceId',
699699
);
700700
if (instance!.onReceivedRequestError != null) {
701701
instance.onReceivedRequestError!(
@@ -718,11 +718,11 @@ class WebViewClientFlutterApiImpl extends WebViewClientFlutterApi {
718718
.getInstanceWithWeakReference(webViewInstanceId) as WebView?;
719719
assert(
720720
instance != null,
721-
'InstanceManager does not contain an WebViewClient with instanceId: $instanceId',
721+
'InstanceManager does not contain a WebViewClient with instanceId: $instanceId',
722722
);
723723
assert(
724724
webViewInstance != null,
725-
'InstanceManager does not contain an WebView with instanceId: $webViewInstanceId',
725+
'InstanceManager does not contain a WebView with instanceId: $webViewInstanceId',
726726
);
727727
if (instance!.requestLoading != null) {
728728
instance.requestLoading!(
@@ -744,11 +744,11 @@ class WebViewClientFlutterApiImpl extends WebViewClientFlutterApi {
744744
.getInstanceWithWeakReference(webViewInstanceId) as WebView?;
745745
assert(
746746
instance != null,
747-
'InstanceManager does not contain an WebViewClient with instanceId: $instanceId',
747+
'InstanceManager does not contain a WebViewClient with instanceId: $instanceId',
748748
);
749749
assert(
750750
webViewInstance != null,
751-
'InstanceManager does not contain an WebView with instanceId: $webViewInstanceId',
751+
'InstanceManager does not contain a WebView with instanceId: $webViewInstanceId',
752752
);
753753
if (instance!.urlLoading != null) {
754754
instance.urlLoading!(webViewInstance!, url);
@@ -798,7 +798,7 @@ class DownloadListenerFlutterApiImpl extends DownloadListenerFlutterApi {
798798
.getInstanceWithWeakReference(instanceId) as DownloadListener?;
799799
assert(
800800
instance != null,
801-
'InstanceManager does not contain an DownloadListener with instanceId: $instanceId',
801+
'InstanceManager does not contain a DownloadListener with instanceId: $instanceId',
802802
);
803803
instance!.onDownloadStart(
804804
url,
@@ -858,11 +858,11 @@ class WebChromeClientFlutterApiImpl extends WebChromeClientFlutterApi {
858858
.getInstanceWithWeakReference(webViewInstanceId) as WebView?;
859859
assert(
860860
instance != null,
861-
'InstanceManager does not contain an WebChromeClient with instanceId: $instanceId',
861+
'InstanceManager does not contain a WebChromeClient with instanceId: $instanceId',
862862
);
863863
assert(
864864
webViewInstance != null,
865-
'InstanceManager does not contain an WebView with instanceId: $webViewInstanceId',
865+
'InstanceManager does not contain a WebView with instanceId: $webViewInstanceId',
866866
);
867867
if (instance!.onProgressChanged != null) {
868868
instance.onProgressChanged!(webViewInstance!, progress);

packages/webview_flutter/webview_flutter_android/lib/src/instance_manager.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class InstanceManager {
9090
/// Returns the identifier associated with the removed instance. Otherwise,
9191
/// `null` if the instance was not found in this manager.
9292
///
93-
/// This does not remove the the strong referenced instance associated with
93+
/// This does not remove the strong referenced instance associated with
9494
/// [instance]. This can be done with [remove].
9595
int? removeWeakReference(Copyable instance) {
9696
final int? identifier = getIdentifier(instance);
@@ -112,7 +112,7 @@ class InstanceManager {
112112
/// it was removed. Returns `null` if [identifier] was not associated with
113113
/// any strong reference.
114114
///
115-
/// This does not remove the the weak referenced instance associtated with
115+
/// This does not remove the weak referenced instance associated with
116116
/// [identifier]. This can be done with [removeWeakReference].
117117
T? remove<T extends Copyable>(int identifier) {
118118
return _strongInstances.remove(identifier) as T?;

packages/webview_flutter/webview_flutter_android/lib/src/weak_reference_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/// final JavascriptChannelRegistry javascriptChannelRegistry = ...
1010
///
1111
/// final WKScriptMessageHandler handler = WKScriptMessageHandler(
12-
/// didReceiveScriptMessage: withWeakRefenceTo(
12+
/// didReceiveScriptMessage: withWeakReferenceTo(
1313
/// javascriptChannelRegistry,
1414
/// (WeakReference<JavascriptChannelRegistry> weakReference) {
1515
/// return (

packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void main() {
210210
)).called(1);
211211
});
212212

213-
test('loadFlutterAsset when asset does not exists', () async {
213+
test('loadFlutterAsset when asset does not exist', () async {
214214
final MockWebView mockWebView = MockWebView();
215215
final MockFlutterAssetManager mockAssetManager =
216216
MockFlutterAssetManager();

packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ void main() {
393393
});
394394

395395
testWidgets(
396-
'loadFlutterAsset throws ArgumentError when asset does not exists',
396+
'loadFlutterAsset throws ArgumentError when asset does not exist',
397397
(WidgetTester tester) async {
398398
await buildWidget(tester);
399399
const String assetKey = 'test_assets/index.html';

0 commit comments

Comments
 (0)