Watch
1
0
Fork
You've already forked Seyyed_arc
0
forked from hesabix/arc
Seyyed_arc/hesabixUI/hesabix_ui/third_party/desktop_drop
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-02 02:55:45 +03:30
..
android add windows installer 2026-08-02 02:55:45 +03:30
lib add shabake tamin newtork 2026-05-20 15:29:47 +00:00
linux add shabake tamin newtork 2026-05-20 15:29:47 +00:00
macos add shabake tamin newtork 2026-05-20 15:29:47 +00:00
test add shabake tamin newtork 2026-05-20 15:29:47 +00:00
windows add shabake tamin newtork 2026-05-20 15:29:47 +00:00
analysis_options.yaml add shabake tamin newtork 2026-05-20 15:29:47 +00:00
CHANGELOG.md add shabake tamin newtork 2026-05-20 15:29:47 +00:00
LICENSE add shabake tamin newtork 2026-05-20 15:29:47 +00:00
pubspec.yaml add shabake tamin newtork 2026-05-20 15:29:47 +00:00
README.md add shabake tamin newtork 2026-05-20 15:29:47 +00:00

desktop_drop

Pub

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.
  desktop_drop: $latest_version
  1. Then you can use DropTarget to receive file drop events.
class ExampleDragTarget extends StatefulWidget {
  const ExampleDragTarget({Key? key}) : super(key: key);

  @override
  _ExampleDragTargetState createState() => _ExampleDragTargetState();
}

class _ExampleDragTargetState extends State<ExampleDragTarget> {
  final List<XFile> _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