drag_and_drop_flutter 0.2.0 copy "drag_and_drop_flutter: ^0.2.0" to clipboard
drag_and_drop_flutter: ^0.2.0 copied to clipboard

outdated

Support native drag and drop of text, files and directories in Flutter.

drag_and_drop_flutter #

pub package

Support native drag and drop in Flutter.

This is a federated plugin. It currently only has an endorsed implementation for web.

Usage #

To use this plugin, add drag_and_drop_flutter as a dependency in your pubspec.yaml file.

Example #

import 'package:flutter/material.dart';
import 'package:drag_and_drop_flutter/drag_and_drop_flutter.dart';

void main() {
  runApp(MaterialApp(
    home: DragDropArea(
      onDrop: (data) {
        final text = data['text/plain']?.toString();
        if (text != null) {
          debugPrint('Dropped text: $text');
        }
      },
      child: const Center(
        child: Text('Drop stuff here'),
      ),
    ),
  ));
}
17
likes
160
points
51
downloads

Publisher

verified publisherjjagg.dev

Weekly Downloads

Support native drag and drop of text, files and directories in Flutter.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

cross_file, drag_and_drop_flutter_platform_interface, drag_and_drop_flutter_web, flutter, flutter_web_plugins

More

Packages that depend on drag_and_drop_flutter