drop_zone
Flutter web में ड्रैग एंड ड्रॉप को लाने का एक सरल तरीका। drop_zone का उपयोग आमतौर पर एक या अधिक फ़ाइलों को निर्धारित विजेट पर खींचकर ड्रॉप करके चुनने के लिए किया जाता है। उपयोगकर्ता बाद में ड्रॉप किए गए HTML फ़ाइलों का उपयोग कर सकता है।
फ्लटर वेब में ड्रैग और ड्रॉप को लाने का एक सरल तरीका
{"sdk":"flutter"}{"sdk":"flutter"}यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
A simple way to bring drag’n’drop to flutter web.
drop_zone is commonly used for file choosing by dragging and dropping a file(s) onto a designated widget. The user can then use the dropped html file(s).
https://raw.githubusercontent.com/derrick56007/dropzone/HEAD/demo.gif?raw=true
An example can be found in the example directory of this repository.
Add drop_zone to pubspec.yaml of your project:
dependencies:
drop_zone: ^1.0.2
Add necessary imports and wrap any widget with DropZone() to use it as a dropzone:
import 'package:drop_zone/drop_zone.dart';
import 'dart:html' as html;
DropZone(
onDragEnter: () {
print('drag enter');
},
onDragExit: () {
print('drag exit');
},
onDrop: (List<html.File> files) {
print('files dropped');
print(files);
},
child: Container(
width: 300,
height: 300,
)
)