drag_and_drop_flutter 0.1.0
drag_and_drop_flutter: ^0.1.0 copied to clipboard
Support native drag and drop of text, files and directories in Flutter.
drag_and_drop_flutter #
Support native drag and drop in Flutter.
This is a federated plugin. It currently only has a 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'),
),
),
));
}