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();
  }

将最后一行注释掉。

相关推荐
恋猫de小郭3 小时前
compose_skill 和 android skills,对 Android 项目提升巨大的专家 AI Skills
android·前端·flutter
空中海3 小时前
5.3 本地存储
flutter
空中海4 小时前
9.4 推送通知
flutter
星释5 小时前
鸿蒙Flutter实战:30.在Pub上发布鸿蒙化插件
flutter·harmonyos·鸿蒙
nice先生的狂想曲5 小时前
flutter布局(列表组件)
flutter
见山是山-见水是水5 小时前
鸿蒙flutter第三方库适配 - 动态工作流
flutter·华为·harmonyos
yeziyfx5 小时前
Flutter SingleChildScrollView内部ListView滑动不了
flutter
Zender Han5 小时前
VS Code 开发 Flutter 常用快捷键和插件工具详解
android·vscode·flutter·ios
于慨6 小时前
flutter安卓调试工具
android·flutter