sensitive_clipboard

A clipboard plugin that allows copy sensitive content to clipboard using the new param sensitive into the Android 13 (API 33).

For more information about it, read the original documentation.

Example

example-gif

Getting Started

This project is an anticipated plugin to avoid sensitive data be shown on Android 13, until Flutter’s official package allows to do the same.

This works with Android and iOS. The main objective is to wrap the original clipboard, allowing to hide sensitive content only for Android 13. If the default platform is iOS, the original clipboard from Flutter will be called.

Because the Android 13 has a pop up dialog, showing the copied content, we need to avoid show feedback message on bottom of your page. For this, you can use the return of the copy method, to guarantee if the sensitive content was hidden for Android 13 and pop up was shown. If the method returns true, the platform is the Android 13, and the pop up shows up – and you should not show your message. If returns false, you can show your feedback message normally.

Usage

1) Add to your package’s pubspec.yaml file:

dependencies:
  sensitive_clipboard: [latest version]

2) Install

$ flutter pub get

3) Import

import 'package:sensitive_clipboard/sensitive_clipboard.dart';

4) Use

SensitiveClipboard.copy('Sensitive-Content');

5) Before you run, config the android/app/build.gradle

android {
    compileSdkVersion 33

License

This project is licensed under the MIT License – see the LICENSE file for details

GitHub

View Github