-
Notifications
You must be signed in to change notification settings - Fork 860
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: add config class for clipboard action buttons (#2433)
* feat!: add config class for clipboard action buttons * docs: update CHANGELOG and migration guide * chore: add a TODO for #2427
- Loading branch information
Showing
5 changed files
with
57 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
lib/src/toolbar/config/buttons/clipboard_button_options.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/// @docImport '../../buttons/clipboard_button.dart'; | ||
@experimental | ||
library; | ||
|
||
import 'package:meta/meta.dart'; | ||
import 'toggle_style_options.dart'; | ||
|
||
@experimental | ||
class QuillToolbarClipboardButtonOptions | ||
extends QuillToolbarToggleStyleButtonOptions { | ||
const QuillToolbarClipboardButtonOptions({ | ||
super.iconData, | ||
super.afterButtonPressed, | ||
super.childBuilder, | ||
super.iconTheme, | ||
super.tooltip, | ||
super.iconSize, | ||
super.iconButtonFactor, | ||
this.enableClipboardPaste, | ||
}); | ||
|
||
/// Determines if the paste button is enabled. The button is disabled and cannot be clicked if set to `false`. | ||
/// | ||
/// Defaults to [ClipboardMonitor] in case of `null`, which checks if the clipboard has content to paste every second and only then enables the button, indicating to the user that they can paste something. | ||
/// | ||
/// Set it to `true` to enable it even if the clipboard has no content to paste, which will do nothing on a press. | ||
final bool? enableClipboardPaste; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters