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

将最后一行注释掉。

相关推荐
yume_sibai3 小时前
02-Flutter进阶开发
前端·flutter
●VON5 小时前
Flutter 鸿蒙插件适配实战:用 is_lock_screen 2.0.0 判断真实锁屏状态
flutter·华为·harmonyos
●VON7 小时前
Flutter 鸿蒙插件适配实战:用 flutter_timezone_observer 1.2.0 监听系统时区变化
flutter·华为·harmonyos
●VON7 小时前
Flutter 鸿蒙 app_install_date 0.1.5 使用实战:读取应用安装时间
flutter·华为·harmonyos
●VON9 小时前
Flutter 鸿蒙插件适配实战:flutter_screenshot_detect 0.1.7 截图事件监听
flutter·华为·harmonyos·鸿蒙
西西学代码1 天前
尾灯-应用层通信协议(BLE)
flutter
恋猫de小郭1 天前
iPhone Duo 适配详解,需要改变的不止是布局模型
前端·flutter·ios
我就是DaLing呀!1 天前
flutter + ffmpeg_kit_extended_flutter 大视频合并下载
flutter·ffmpeg·音视频
程序员老刘2 天前
Dart Skills CLI 1.0发布,老刘年初的预言兑现了
flutter·ai编程·dart