# desktop_drop **Repository Path**: wangpggg/desktop_drop ## Basic Information - **Project Name**: desktop_drop - **Description**: 改变开源状态!!!!! - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-09-26 - **Last Updated**: 2026-03-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # desktop_drop [![Pub](https://img.shields.io/pub/v/desktop_drop.svg)](https://pub.dev/packages/desktop_drop) A plugin which allows user dragging files to your flutter desktop applications. | | | |---------|------------| | Windows | ✅ | | Linux | ✅ | | macOS | ✅ | | Android | ✅(preview) | | Web | ✅ | ## Getting Started 1. Add `desktop_drop` to your `pubspec.yaml`. ```yaml desktop_drop: $latest_version ``` 2. Then you can use `DropTarget` to receive file drop events. ```dart class ExampleDragTarget extends StatefulWidget { const ExampleDragTarget({Key? key}) : super(key: key); @override _ExampleDragTargetState createState() => _ExampleDragTargetState(); } class _ExampleDragTargetState extends State { final List _list = []; bool _dragging = false; @override Widget build(BuildContext context) { return DropTarget( onDragDone: (detail) { setState(() { _list.addAll(detail.files); }); }, onDragEntered: (detail) { setState(() { _dragging = true; }); }, onDragExited: (detail) { setState(() { _dragging = false; }); }, child: Container( height: 200, width: 200, color: _dragging ? Colors.blue.withOpacity(0.4) : Colors.black26, child: _list.isEmpty ? const Center(child: Text("Drop here")) : Text(_list.join("\n")), ), ); } } ``` ## LICENSE see LICENSE file