v1.0.2
drop_zone
Flutter 웹에 드래그 앤 드롭을 간단하게 도입하는 방법입니다. drop_zone은 일반적으로 지정된 위젯 위에 파일을 드래그하여 놓음으로써 파일 선택에 사용됩니다. 사용자는 드롭된 HTML 파일을 사용할 수 있습니다.
46좋아요 2천30일 다운로드120Pub 점수
Web
Flutter 웹에 드래그 앤 드롭을 쉽게 도입하는 방법
{"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,
)
)