Skip to content

Commit 74f2cb1

Browse files
Adjusted comments & documentation
1 parent f34bf49 commit 74f2cb1

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

lib/src/toolbar/buttons/clipboard_button.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,16 @@ class ClipboardMonitor {
3737
return;
3838
}
3939

40-
// Prevent multiple clipboard checks at the same time.
4140
_isCheckingClipboard = true;
4241

43-
// Initialize the clipboard service.
4442
final clipboardService = ClipboardServiceProvider.instance;
4543

46-
// Check if the clipboard has content.
4744
if (await clipboardService.hasClipboardContent) {
48-
// If the clipboard has content, set the flag to true.
4945
_canPaste = true;
5046

51-
// Notify the listener that the clipboard has content.
5247
listener();
5348
}
5449

55-
// Prevent multiple clipboard checks at the same time.
5650
_isCheckingClipboard = false;
5751
}
5852
}

lib/src/toolbar/config/base_button_options.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ class QuillToolbarBaseButtonOptions<T, I> {
6666
/// Use custom theme
6767
final QuillIconTheme? iconTheme;
6868

69-
/// Disables the [ClipboardMonitor] of [QuillToolbarClipboardButton] if not null
70-
/// If true or false, it will enable or disable the clipboard paste button
71-
/// Only affects the clipboard paste button
69+
/// Determines if the paste button is enabled.
70+
///
71+
/// Defaults to [ClipboardMonitor] in case of `null`, which will check if the clipboard has content to paste every second, and only then enable the button, indicating to the user that they can paste something.
72+
///
73+
/// Set to `true` to always enable it even if the clipboard has no content to paste, which will do nothing on a press.
7274
final bool? enableClipboardPaste;
7375

7476
/// If you want to display a different widget based using a builder

0 commit comments

Comments
 (0)