clipboard_all_types 0.0.1 copy "clipboard_all_types: ^0.0.1" to clipboard
clipboard_all_types: ^0.0.1 copied to clipboard

unlistedoutdated

This package get all types of data from clipboard

clipboard_all_types #

This package get all types of data from clipboard

Install #

  • Add clipboard_all_types to your dependencies list in pubspec.yaml file
dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  clipboard_all_types: ^0.0.1
  • Run flutter packages get from your root project

  • import the package by import 'package:clipboard_all_types/clipboard_all_types.dart';

Usage #

final List<MemoryImage> _image = [];
  String? text;

  Future<void> onPasteCallback(ClipboardFiles files) async {
    switch (files.type) {
      case ClipboardType.image:
        setState(() {
          _image.add(MemoryImage(files.file!));
          text = null;
        });
        break;
      case ClipboardType.text:
        setState(() {
          text = files.text!;
        });
        break;
      case ClipboardType.video:
        setState(() {
          text = "Video handled";
        });
        break;
      case ClipboardType.audio:
        setState(() {
          text = "Audio handled";
        });
        break;
      case ClipboardType.otherFiles:
        setState(() {
          text = "Other files handled";
        });
        break;
      default:
    }
  }

Example #

the plugin comes with an simplest example app. run it to see it in working.

10
likes
140
pub points
34%
popularity

Publisher

verified publishermerterim.dev

This package get all types of data from clipboard

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on clipboard_all_types