Skip to content

Commit ae51e84

Browse files
authored
Merge pull request #5 from getBoolean/bug-4
Fix Dropping Bugs
2 parents e76a20e + b8c8875 commit ae51e84

File tree

8 files changed

+227
-97
lines changed

8 files changed

+227
-97
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 0.0.3+2
2+
* Added boolean `NativeDropView.receiveNonAllowedItems` to allow non-allowed items to be dropped if at least one item in the dropping session was allowed
3+
* Fixed a bug where files such as PDF would be categorized as DropDataType.pdf even if only DropDataType.file was allowed
4+
* Fixed a bug where documents (such as .numbers) dropped from iCloud would not be accepted
5+
* Refactor iOS Swift code for readability
6+
7+
Thank you @getBoolean
8+
19
## 0.0.3+1
210
* Files from iCloud no longer need to be added directly to allowedDropFileExtensions when dataType == DropDataType.file
311
* Updated Readme

example/lib/src/dropped_image_list_title.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class DroppedImageListTile extends StatelessWidget {
3030
backgroundImage: MemoryImage(snapshot.data!),
3131
),
3232
title: Text(dropData.dropFile?.path ?? 'Path unknown'),
33+
subtitle: Text(dropData.type.toString()),
3334
);
3435
}
3536

@@ -39,6 +40,7 @@ class DroppedImageListTile extends StatelessWidget {
3940
child: CircularProgressIndicator(),
4041
),
4142
title: Text(dropData.dropFile?.path ?? 'Path unknown'),
43+
subtitle: Text(dropData.type.toString()),
4244
);
4345
},
4446
);

example/lib/src/home_view.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ class _ListNativeDropViewState extends State<ListNativeDropView> {
274274
allowedTotal: widget.allowedItemsAtOnce,
275275
allowedDropDataTypes: widget.allowedDataTypes,
276276
allowedDropFileExtensions: widget.allowedFileExtensions,
277+
receiveNonAllowedItems: false,
277278
created: widget.created,
278279
child: receivedData.isNotEmpty
279280
? ListView.builder(
@@ -284,6 +285,7 @@ class _ListNativeDropViewState extends State<ListNativeDropView> {
284285
if (data.type == DropDataType.text) {
285286
return ListTile(
286287
title: Text(data.dropText!),
288+
subtitle: Text(data.type.toString()),
287289
);
288290
}
289291
if (data.type == DropDataType.image) {
@@ -294,6 +296,7 @@ class _ListNativeDropViewState extends State<ListNativeDropView> {
294296

295297
return ListTile(
296298
title: Text(data.dropFile!.path),
299+
subtitle: Text(data.type.toString()),
297300
);
298301
})
299302
: const Center(

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ packages:
101101
path: ".."
102102
relative: true
103103
source: path
104-
version: "0.0.3+1"
104+
version: "0.0.3+2"
105105
path:
106106
dependency: transitive
107107
description:

0 commit comments

Comments
 (0)