Skip to content

Commit 206f929

Browse files
committed
chore: rename closeWebPasteEvent() to cancelWebPasteEvent(), improve doc of _webPasteEventSubscription
1 parent 3e118b2 commit 206f929

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/src/controller/quill_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ class QuillController extends ChangeNotifier {
477477

478478
_isDisposed = true;
479479
if (kIsWeb) {
480-
closeWebPasteEvent();
480+
cancelWebPasteEvent();
481481
}
482482
super.dispose();
483483
}

lib/src/controller/web/quill_controller_web_real.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import '../quill_controller_rich_paste.dart';
1010

1111
/// Paste event for the web.
1212
///
13-
/// Will be `null` for non-web platforms.
13+
/// Will be `null` when [QuillControllerWeb.initializeWebPasteEvent] was not called
14+
/// or the subscription was canceled due to calling [QuillControllerWeb.cancelWebPasteEvent]
1415
///
1516
/// See: https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event
1617
StreamSubscription? _webPasteEventSubscription;
@@ -30,7 +31,7 @@ extension QuillControllerWeb on QuillController {
3031
});
3132
}
3233

33-
void closeWebPasteEvent() {
34+
void cancelWebPasteEvent() {
3435
_webPasteEventSubscription?.cancel();
3536
_webPasteEventSubscription = null;
3637
}

lib/src/controller/web/quill_controller_web_stub.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extension QuillControllerWeb on QuillController {
1212
);
1313
}
1414

15-
void closeWebPasteEvent() {
15+
void cancelWebPasteEvent() {
1616
throw UnsupportedError(
1717
'The closeWebPasteEvent() method should be called only on web.',
1818
);

0 commit comments

Comments
 (0)