Skip to content

Commit

Permalink
fix(cat-voices): Fix tests in main (#963)
Browse files Browse the repository at this point in the history
* fix: Fix tests in main

* fix: Fix tests in main

---------

Co-authored-by: Dominik Toton <166132265+dtscalac@users.noreply.github.com>
  • Loading branch information
digitalheartxs and dtscalac authored Oct 4, 2024
1 parent fca1d62 commit 980e714
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
24 changes: 12 additions & 12 deletions catalyst_voices/lib/widgets/modals/voices_upload_file_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import 'package:catalyst_voices_models/catalyst_voices_models.dart';
import 'package:catalyst_voices_shared/catalyst_voices_shared.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dropzone/flutter_dropzone.dart';
import 'package:web/web.dart' as web;

class VoicesUploadFileDialog extends StatefulWidget {
final String title;
Expand Down Expand Up @@ -253,14 +253,15 @@ class _UploadContainerState extends State<_UploadContainer> {
color: Theme.of(context).colors.iconsPrimary!,
child: Stack(
children: [
DropzoneView(
operation: DragOperation.copy,
cursor: CursorType.grab,
onCreated: (DropzoneViewController ctrl) => setState(() {
_dropzoneController = ctrl;
}),
onDrop: (ev) async {
if (ev is web.File) {
// We allow drag&drop only on web
if (kIsWeb)
DropzoneView(
operation: DragOperation.copy,
cursor: CursorType.grab,
onCreated: (DropzoneViewController ctrl) => setState(() {
_dropzoneController = ctrl;
}),
onDrop: (ev) async {
final bytes = await _dropzoneController.getFileData(ev);
final name = await _dropzoneController.getFilename(ev);
widget.onFileSelected?.call(
Expand All @@ -269,9 +270,8 @@ class _UploadContainerState extends State<_UploadContainer> {
bytes: bytes,
),
);
}
},
),
},
),
InkWell(
onTap: () async {
final result = await FilePicker.platform.pickFiles(
Expand Down
1 change: 0 additions & 1 deletion catalyst_voices/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ dependencies:
sentry_flutter: ^8.8.0
url_launcher: ^6.2.2
url_strategy: ^0.3.0
web: ^1.1.0
# TODO(dtscalac): win32 dependency is just a transitive dependency and shouldn't be imported
# but here we import it explicitly to make sure the latest version is used which addresses
# the problem from here: https://github.com/jonataslaw/get_cli/issues/263
Expand Down

0 comments on commit 980e714

Please sign in to comment.