vivo审核不通过,flutter读取剪贴板内容

审核结果:明示SDK未同意收集

其实是Flutter 源码 editable_text.dart 中 void copySelection(SelectionChangedCause cause) 方法里面,在读取剪切板。

复制代码
 /// Copy current selection to [Clipboard].
  @override
  void copySelection(SelectionChangedCause cause) {
    final TextSelection selection = textEditingValue.selection;
    if (selection.isCollapsed || widget.obscureText) {
      return;
    }
    final String text = textEditingValue.text;
    Clipboard.setData(ClipboardData(text: selection.textInside(text)));
    if (cause == SelectionChangedCause.toolbar) {
      bringIntoView(textEditingValue.selection.extent);
      hideToolbar(false);

      switch (defaultTargetPlatform) {
        case TargetPlatform.iOS:
        case TargetPlatform.macOS:
        case TargetPlatform.linux:
        case TargetPlatform.windows:
          break;
        case TargetPlatform.android:
        case TargetPlatform.fuchsia:
          // Collapse the selection and hide the toolbar and handles.
          userUpdateTextEditingValue(
            TextEditingValue(
              text: textEditingValue.text,
              selection: TextSelection.collapsed(offset: textEditingValue.selection.end),
            ),
            SelectionChangedCause.toolbar,
          );
      }
    }
    // 把此行注释掉,再打包即可
    // clipboardStatus.update();
  }

将最后一行注释掉。

相关推荐
传奇开心果编程3 小时前
【Flutter踩坑排雷】第28课:平台目录缺失与修复坑|`flutter create` 的“重建”与“覆盖”边界
android·flutter·ios·移动开发·跨平台·dart·声明式ui
程序员老刘·20 小时前
Flutter 3.50更新,开发者应该关注什么?
flutter·ai编程·跨平台开发
传奇开心果编程2 天前
【Flutter踩坑排雷】第25课:ScrollController 误用坑|跳转失效、监听泄漏与“控制器未附加”
android·flutter·ios·移动开发·跨平台·dart·声明式ui
程序员老刘2 天前
Flutter 3.50更新,开发者应该关注什么?
flutter·ai编程·客户端
好的佩奇3 天前
Dart 之集合元素
android·flutter·dart
恋猫de小郭3 天前
Flutter 3.50 & Dart 3.14 发布,快来看看有什么更新吧
android·前端·flutter
喵个咪4 天前
GoWind CMS 拆解:Flutter 设计系统内核——双态 token、四档断点与自适应壳层
前端·flutter·交互设计
恋猫de小郭4 天前
Flutter 大小核优化又被回滚,然后又开新提案?
android·前端·flutter
好的佩奇5 天前
蓝牙之广播与扫描
android·flutter·蓝牙