主题
ShareText 继承自: ClientAction
当控件被激活时,使用文本打开平台共享面板。
等价于 share_text,但由客户端在用户的手势操作内执行,这也是浏览器唯一允许调用 navigator.share 的时机。
共享结果不会回传——如果需要结果,请使用 share_text,但请注意它在 iOS 的 Web 端无法使用。
Example: python ft.Button( "Share", action=ft.ShareText("Check out Flet", subject="Flet"), )
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
text | str | action_ | The text to share. |
title | Optional[str] | action_None | Title shown in the share sheet. |
subject | Optional[str] | action_None | Subject used by targets that support one, such as email. |
service_id | int | 0 | Internal id of the service that performs this action on the client. |
method | str | '' | Name of the service method invoked on the client. |
args | dict[str, Any] | {} | Arguments passed to method. |