getClipboardData method
get clipboard data from the clipboard asynchronously.
Returns:
Implementation
@override
Future<Map<String, String>?> getClipboardData() async {
/// Read raw clipboard text from the DOM.
final ClipboardData? clipboardData = await Clipboard.getData(Clipboard.kTextPlain);
if (clipboardData == null) {
/// Return null if clipboard is empty or unsupported.
return null;
}
return <String, String>{
'plainText': clipboardData.text ?? '',
'htmlText': '', // since htmlText is not supported, return empty string.
};
}