readTextFromClipboard method
Bot API 6.4+ A method that requests text from the clipboard. The Mini App will receive the event clipboardTextReceived. If an optional callback parameter was passed, the callback function will be called and the text from the clipboard will be passed as the first argument.
Note: this method can be called only for Mini Apps launched from the attachment menu and only in response to a user interaction with the Mini App interface (e.g. a click inside the Mini App or on the main button).
Implementation
@override
void readTextFromClipboard([void Function(String clipboardText)? onRead]) =>
Telegram.WebApp.readTextFromClipboard(onRead?.toJS);