Skip to content

Commit d9762b5

Browse files
committed
Revert code back in to get extension
There is a function for it, but it adds the dot. Since it's a simple problem I'd rather have this solution than having to remove the dot.
1 parent d5f55fb commit d9762b5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/widgets/controls/drop_area.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'package:desktop_drop/desktop_drop.dart';
66
import 'package:file_picker/file_picker.dart';
77
import 'package:fluent_ui/fluent_ui.dart';
88
import 'package:flutter_svg/svg.dart';
9-
import 'package:path/path.dart';
109

1110
class DropArea extends StatefulWidget {
1211
final Widget? child;
@@ -34,7 +33,10 @@ class _DropAreaState extends State<DropArea> {
3433
void handleDrop(DropDoneDetails details) {
3534
widget.onUpload(
3635
details.files
37-
.where((file) => widget.extensions?.contains(extension(file.path, 1)) ?? true)
36+
.where((file) {
37+
String extension = file.path.split('.').last.toLowerCase(); // Extract file extension
38+
return widget.extensions?.contains(extension) ?? true;
39+
})
3840
.map((f) => f.path)
3941
.toList()
4042
);

0 commit comments

Comments
 (0)