@@ -10,9 +10,9 @@ import 'package:catalyst_voices_models/catalyst_voices_models.dart';
10
10
import 'package:catalyst_voices_shared/catalyst_voices_shared.dart' ;
11
11
import 'package:dotted_border/dotted_border.dart' ;
12
12
import 'package:file_picker/file_picker.dart' ;
13
+ import 'package:flutter/foundation.dart' ;
13
14
import 'package:flutter/material.dart' ;
14
15
import 'package:flutter_dropzone/flutter_dropzone.dart' ;
15
- import 'package:web/web.dart' as web;
16
16
17
17
class VoicesUploadFileDialog extends StatefulWidget {
18
18
final String title;
@@ -253,14 +253,15 @@ class _UploadContainerState extends State<_UploadContainer> {
253
253
color: Theme .of (context).colors.iconsPrimary! ,
254
254
child: Stack (
255
255
children: [
256
- DropzoneView (
257
- operation: DragOperation .copy,
258
- cursor: CursorType .grab,
259
- onCreated: (DropzoneViewController ctrl) => setState (() {
260
- _dropzoneController = ctrl;
261
- }),
262
- onDrop: (ev) async {
263
- if (ev is web.File ) {
256
+ // We allow drag&drop only on web
257
+ if (kIsWeb)
258
+ DropzoneView (
259
+ operation: DragOperation .copy,
260
+ cursor: CursorType .grab,
261
+ onCreated: (DropzoneViewController ctrl) => setState (() {
262
+ _dropzoneController = ctrl;
263
+ }),
264
+ onDrop: (ev) async {
264
265
final bytes = await _dropzoneController.getFileData (ev);
265
266
final name = await _dropzoneController.getFilename (ev);
266
267
widget.onFileSelected? .call (
@@ -269,9 +270,8 @@ class _UploadContainerState extends State<_UploadContainer> {
269
270
bytes: bytes,
270
271
),
271
272
);
272
- }
273
- },
274
- ),
273
+ },
274
+ ),
275
275
InkWell (
276
276
onTap: () async {
277
277
final result = await FilePicker .platform.pickFiles (
0 commit comments