首页 > 解决方案 > Flutter SelectableText 在iOS上没有全选选项

问题描述

我正在使用SelectableText.rich()小部件来允许用户复制显示的文本。在 Android 上,工具栏中的默认选项是复制和全选 - 我也可以自定义它。在 iOS 上,默认选项似乎只有 Copy 并且设置ToolbarOptions不会改变它(只有当我将 copy 设置为 false 时,它​​才会消失)。我的目标是在 Android 和 iOS 上显示 Copy 和 Select All 选项。我错过了什么还是某种错误?

SelectableText.rich(
                          TextSpan(children: [
                            TextSpan(
                              text: "Name\n",
                              style:
                                  TextStyles.getDetailViewLabelStyle(context),
                            ),
                            TextSpan(
                              text: projectName,
                              style:
                                  TextStyles.getDetailViewContentStyle(context),
                            )
                          ]),
                          toolbarOptions:
                              const ToolbarOptions(copy: true, selectAll: true),
                        ),

标签: iosflutter

解决方案


推荐阅读