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

将最后一行注释掉。

相关推荐
treasure1403 小时前
Flutter低级教程(2027年1月重制版)
android·flutter·ios·gui·web·dart·移动端
好的佩奇2 天前
Dart 之文件读写
android·flutter·dart
Nerd(BUG版)3 天前
Flutter学习day19--MethodChannel打通Dart与原生
学习·flutter
传奇开心果编程3 天前
【六大移动UI框架比较学与练】第5课:交互与导航——事件处理、手势与页面路由实战对照
android·flutter·react native·ios·swiftui·移动开发·android jetpack
恋猫de小郭3 天前
Flutter Analyzer ,这玩意还有这么大的优化空间
android·前端·flutter
hai_android3 天前
从导入视频到上屏出声:Android + FFmpeg 播放器全流程拆解
android·flutter·ffmpeg·kotlin·android studio·音视频·android jetpack
Bowen_J4 天前
Flutter和Dart 网络协议实现
网络协议·flutter·dart
SoaringHeart4 天前
Flutter组件封装:聊天气包图片组件NChatBubble
前端·flutter
传奇开心果编程4 天前
【六大移动UI框架比较学与练】第3课:文本、图片、布局核心组件实战对照
android·flutter·react native·ios·swiftui·移动开发·android jetpack