requestWriteAccess method
Bot API 6.9+ A method that shows a native popup requesting permission for the bot to send messages to the user. If an optional callback parameter was passed, the callback function will be called when the popup is closed and the first argument will be a boolean indicating whether the user granted this access.
Implementation
@override
void requestWriteAccess({required void Function(bool granted) onResult}) =>
Telegram.WebApp.requestWriteAccess(onResult.toJS);