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

+67
-63
lines changed

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';

packages/webview_flutter/webview_flutter_platform_interface/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
## 2.1.0
67

packages/webview_flutter/webview_flutter_platform_interface/lib/src/legacy/platform_interface/webview_platform.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ abstract class WebViewPlatform {
3737
///
3838
/// `gestureRecognizers` specifies which gestures should be consumed by the web view.
3939
/// It is possible for other gesture recognizers to be competing with the web view on pointer
40-
/// events, e.g if the web view is inside a [ListView] the [ListView] will want to handle
40+
/// events, e.g. if the web view is inside a [ListView] the [ListView] will want to handle
4141
/// vertical drags. The web view will claim gestures that are recognized by any of the
4242
/// recognizers on this list.
4343
/// When `gestureRecognizers` is empty or null, the web view will only handle pointer events for gestures that

packages/webview_flutter/webview_flutter_platform_interface/lib/src/legacy/types/javascript_channel.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class JavascriptChannel {
2929
/// The name must start with a letter or underscore(_), followed by any combination of those
3030
/// characters plus digits.
3131
///
32-
/// Note that any JavaScript existing `window` property with this name will be overriden.
32+
/// Note that any JavaScript existing `window` property with this name will be overridden.
3333
///
3434
/// See also [WebView.javascriptChannels] for more details on the channel registration mechanism.
3535
final String name;

packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/platform_webview_widget_creation_params.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class PlatformWebViewWidgetCreationParams {
7373
/// web view.
7474
///
7575
/// It is possible for other gesture recognizers to be competing with the web
76-
/// view on pointer events, e.g if the web view is inside a [ListView] the
76+
/// view on pointer events, e.g. if the web view is inside a [ListView] the
7777
/// [ListView] will want to handle vertical drags. The web view will claim
7878
/// gestures that are recognized by any of the recognizers on this list.
7979
///

packages/webview_flutter/webview_flutter_wkwebview/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
## 3.2.3
67

packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/legacy/webview_flutter_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ class CopyableObjectWithCallback with Copyable {
12931293
class ClassWithCallbackClass {
12941294
ClassWithCallbackClass() {
12951295
callbackClass = CopyableObjectWithCallback(
1296-
withWeakRefenceTo(
1296+
withWeakReferenceTo(
12971297
this,
12981298
(WeakReference<ClassWithCallbackClass> weakReference) {
12991299
return () {

packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/webview_flutter_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ class CopyableObjectWithCallback with Copyable {
11991199
class ClassWithCallbackClass {
12001200
ClassWithCallbackClass() {
12011201
callbackClass = CopyableObjectWithCallback(
1202-
withWeakRefenceTo(
1202+
withWeakReferenceTo(
12031203
this,
12041204
(WeakReference<ClassWithCallbackClass> weakReference) {
12051205
return () {

packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFGeneratedWebKitApis.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ extern void FWFWKWebViewConfigurationHostApiSetup(
402402
/// The codec used by FWFWKWebViewConfigurationFlutterApi.
403403
NSObject<FlutterMessageCodec> *FWFWKWebViewConfigurationFlutterApiGetCodec(void);
404404

405-
/// Handles callbacks from an WKWebViewConfiguration instance.
405+
/// Handles callbacks from a WKWebViewConfiguration instance.
406406
///
407407
/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc.
408408
@interface FWFWKWebViewConfigurationFlutterApi : NSObject
@@ -479,7 +479,7 @@ extern void FWFWKScriptMessageHandlerHostApiSetup(
479479
/// The codec used by FWFWKScriptMessageHandlerFlutterApi.
480480
NSObject<FlutterMessageCodec> *FWFWKScriptMessageHandlerFlutterApiGetCodec(void);
481481

482-
/// Handles callbacks from an WKScriptMessageHandler instance.
482+
/// Handles callbacks from a WKScriptMessageHandler instance.
483483
///
484484
/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc.
485485
@interface FWFWKScriptMessageHandlerFlutterApi : NSObject
@@ -507,7 +507,7 @@ extern void FWFWKNavigationDelegateHostApiSetup(
507507
/// The codec used by FWFWKNavigationDelegateFlutterApi.
508508
NSObject<FlutterMessageCodec> *FWFWKNavigationDelegateFlutterApiGetCodec(void);
509509

510-
/// Handles callbacks from an WKNavigationDelegate instance.
510+
/// Handles callbacks from a WKNavigationDelegate instance.
511511
///
512512
/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc.
513513
@interface FWFWKNavigationDelegateFlutterApi : NSObject
@@ -670,7 +670,7 @@ extern void FWFWKUIDelegateHostApiSetup(id<FlutterBinaryMessenger> binaryMesseng
670670
/// The codec used by FWFWKUIDelegateFlutterApi.
671671
NSObject<FlutterMessageCodec> *FWFWKUIDelegateFlutterApiGetCodec(void);
672672

673-
/// Handles callbacks from an WKUIDelegate instance.
673+
/// Handles callbacks from a WKUIDelegate instance.
674674
///
675675
/// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc.
676676
@interface FWFWKUIDelegateFlutterApi : NSObject

packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/weak_reference_utils.dart

Lines changed: 2 additions & 2 deletions
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 (
@@ -25,7 +25,7 @@
2525
/// ),
2626
/// );
2727
/// ```
28-
S withWeakRefenceTo<T extends Object, S extends Object>(
28+
S withWeakReferenceTo<T extends Object, S extends Object>(
2929
T reference,
3030
S Function(WeakReference<T> weakReference) onCreate,
3131
) {

packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ class WKWebViewConfigurationHostApi {
932932
}
933933
}
934934

935-
/// Handles callbacks from an WKWebViewConfiguration instance.
935+
/// Handles callbacks from a WKWebViewConfiguration instance.
936936
///
937937
/// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc.
938938
abstract class WKWebViewConfigurationFlutterApi {
@@ -1272,7 +1272,7 @@ class _WKScriptMessageHandlerFlutterApiCodec extends StandardMessageCodec {
12721272
}
12731273
}
12741274

1275-
/// Handles callbacks from an WKScriptMessageHandler instance.
1275+
/// Handles callbacks from a WKScriptMessageHandler instance.
12761276
///
12771277
/// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc.
12781278
abstract class WKScriptMessageHandlerFlutterApi {
@@ -1394,7 +1394,7 @@ class _WKNavigationDelegateFlutterApiCodec extends StandardMessageCodec {
13941394
}
13951395
}
13961396

1397-
/// Handles callbacks from an WKNavigationDelegate instance.
1397+
/// Handles callbacks from a WKNavigationDelegate instance.
13981398
///
13991399
/// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc.
14001400
abstract class WKNavigationDelegateFlutterApi {
@@ -2454,7 +2454,7 @@ class _WKUIDelegateFlutterApiCodec extends StandardMessageCodec {
24542454
}
24552455
}
24562456

2457-
/// Handles callbacks from an WKUIDelegate instance.
2457+
/// Handles callbacks from a WKUIDelegate instance.
24582458
///
24592459
/// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc.
24602460
abstract class WKUIDelegateFlutterApi {

packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ class NSObject with Copyable {
279279
/// Otherwise, use [NSObject.dispose] to release the associated Objective-C
280280
/// object manually.
281281
///
282-
/// See [withWeakRefenceTo].
282+
/// See [withWeakReferenceTo].
283283
/// {@endtemplate}
284284
final void Function(
285285
String keyPath,

packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class WebKitWebViewPlatformController extends WebViewPlatformController {
130130

131131
/// Methods for handling navigation changes and tracking navigation requests.
132132
@visibleForTesting
133-
late final WKNavigationDelegate navigationDelegate = withWeakRefenceTo(
133+
late final WKNavigationDelegate navigationDelegate = withWeakReferenceTo(
134134
this,
135135
(WeakReference<WebKitWebViewPlatformController> weakReference) {
136136
return webViewProxy.createNavigationDelegate(
@@ -199,7 +199,7 @@ class WebKitWebViewPlatformController extends WebViewPlatformController {
199199

200200
webView = webViewProxy.createWebView(
201201
configuration,
202-
observeValue: withWeakRefenceTo(
202+
observeValue: withWeakReferenceTo(
203203
callbacksHandler,
204204
(WeakReference<WebViewPlatformCallbacksHandler> weakReference) {
205205
return (
@@ -437,7 +437,7 @@ class WebKitWebViewPlatformController extends WebViewPlatformController {
437437
(String channelName) {
438438
final WKScriptMessageHandler handler =
439439
webViewProxy.createScriptMessageHandler(
440-
didReceiveScriptMessage: withWeakRefenceTo(
440+
didReceiveScriptMessage: withWeakReferenceTo(
441441
javascriptChannelRegistry,
442442
(WeakReference<JavascriptChannelRegistry> weakReference) {
443443
return (

0 commit comments

Comments
 (0)