From 65ff49345f8f2f040f51bbf6ebfc6f7a24e381fe Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sat, 15 Jul 2023 10:55:36 +0200 Subject: [PATCH] fix(neon_files): Use universal_io to compile for web Signed-off-by: jld3103 --- packages/neon/neon/lib/src/app.dart | 2 +- packages/neon/neon/lib/src/platform/linux.dart | 3 +-- packages/neon/neon/lib/src/platform/platform.dart | 2 +- packages/neon/neon/lib/src/utils/global_options.dart | 3 ++- packages/neon/neon/lib/src/utils/save_file.dart | 2 +- packages/neon/neon/lib/src/widgets/error.dart | 2 +- packages/neon/neon/pubspec.yaml | 1 + packages/neon/neon_files/lib/neon_files.dart | 2 +- packages/neon/neon_files/pubspec.yaml | 1 + 9 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/neon/neon/lib/src/app.dart b/packages/neon/neon/lib/src/app.dart index 42a61086..1726389e 100644 --- a/packages/neon/neon/lib/src/app.dart +++ b/packages/neon/neon/lib/src/app.dart @@ -1,6 +1,5 @@ import 'dart:async'; import 'dart:convert'; -import 'dart:io'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; @@ -27,6 +26,7 @@ import 'package:nextcloud/core.dart' as core; import 'package:nextcloud/nextcloud.dart'; import 'package:quick_actions/quick_actions.dart'; import 'package:tray_manager/tray_manager.dart' as tray; +import 'package:universal_io/io.dart'; import 'package:window_manager/window_manager.dart'; @internal diff --git a/packages/neon/neon/lib/src/platform/linux.dart b/packages/neon/neon/lib/src/platform/linux.dart index 4c3f5b2c..b244f390 100644 --- a/packages/neon/neon/lib/src/platform/linux.dart +++ b/packages/neon/neon/lib/src/platform/linux.dart @@ -1,9 +1,8 @@ -import 'dart:io'; - import 'package:meta/meta.dart'; import 'package:neon/src/platform/platform.dart'; import 'package:path/path.dart' as p; import 'package:sqflite_common_ffi/sqflite_ffi.dart'; +import 'package:universal_io/io.dart'; @immutable @internal diff --git a/packages/neon/neon/lib/src/platform/platform.dart b/packages/neon/neon/lib/src/platform/platform.dart index 6393ea2a..ad96413d 100644 --- a/packages/neon/neon/lib/src/platform/platform.dart +++ b/packages/neon/neon/lib/src/platform/platform.dart @@ -1,9 +1,9 @@ import 'dart:async'; -import 'dart:io'; import 'package:meta/meta.dart'; import 'package:neon/src/platform/android.dart'; import 'package:neon/src/platform/linux.dart'; +import 'package:universal_io/io.dart'; /// Implements platform specific functionality and exposes the availability of certain features. @immutable diff --git a/packages/neon/neon/lib/src/utils/global_options.dart b/packages/neon/neon/lib/src/utils/global_options.dart index c2d93699..48c84a16 100644 --- a/packages/neon/neon/lib/src/utils/global_options.dart +++ b/packages/neon/neon/lib/src/utils/global_options.dart @@ -1,4 +1,4 @@ -import 'dart:io'; +import 'dart:async'; import 'package:flutter/material.dart'; import 'package:meta/meta.dart'; @@ -10,6 +10,7 @@ import 'package:neon/src/settings/models/options_collection.dart'; import 'package:neon/src/settings/models/storage.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:universal_io/io.dart'; const unifiedPushNextPushID = 'org.unifiedpush.distributor.nextpush'; diff --git a/packages/neon/neon/lib/src/utils/save_file.dart b/packages/neon/neon/lib/src/utils/save_file.dart index 36b27c83..b265d881 100644 --- a/packages/neon/neon/lib/src/utils/save_file.dart +++ b/packages/neon/neon/lib/src/utils/save_file.dart @@ -1,9 +1,9 @@ -import 'dart:io'; import 'dart:typed_data'; import 'package:file_picker/file_picker.dart'; import 'package:flutter_file_dialog/flutter_file_dialog.dart'; import 'package:neon/src/platform/platform.dart'; +import 'package:universal_io/io.dart'; Future saveFileWithPickDialog(final String fileName, final Uint8List data) async { if (NeonPlatform.instance.shouldUseFileDialog) { diff --git a/packages/neon/neon/lib/src/widgets/error.dart b/packages/neon/neon/lib/src/widgets/error.dart index 073469aa..70fc5947 100644 --- a/packages/neon/neon/lib/src/widgets/error.dart +++ b/packages/neon/neon/lib/src/widgets/error.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:io'; import 'package:flutter/material.dart'; import 'package:http/http.dart'; @@ -10,6 +9,7 @@ import 'package:neon/src/router.dart'; import 'package:neon/src/utils/exceptions.dart'; import 'package:neon/src/utils/provider.dart'; import 'package:nextcloud/nextcloud.dart'; +import 'package:universal_io/io.dart'; /// An indicator that an [error] has occurred. /// diff --git a/packages/neon/neon/pubspec.yaml b/packages/neon/neon/pubspec.yaml index 839ef553..d0c41bba 100644 --- a/packages/neon/neon/pubspec.yaml +++ b/packages/neon/neon/pubspec.yaml @@ -51,6 +51,7 @@ dependencies: tray_manager: ^0.2.0 unifiedpush: ^5.0.0 unifiedpush_android: ^2.0.0 + universal_io: ^2.0.0 url_launcher: ^6.1.0 vector_graphics: ^1.0.0 window_manager: ^0.3.0 diff --git a/packages/neon/neon_files/lib/neon_files.dart b/packages/neon/neon_files/lib/neon_files.dart index 739242f2..d6df44da 100644 --- a/packages/neon/neon_files/lib/neon_files.dart +++ b/packages/neon/neon_files/lib/neon_files.dart @@ -1,7 +1,6 @@ library neon_files; import 'dart:async'; -import 'dart:io'; import 'package:collection/collection.dart'; import 'package:file_icons/file_icons.dart'; @@ -30,6 +29,7 @@ import 'package:path_provider/path_provider.dart'; import 'package:queue/queue.dart'; import 'package:rxdart/rxdart.dart'; import 'package:share_plus/share_plus.dart'; +import 'package:universal_io/io.dart'; part 'blocs/browser.dart'; part 'blocs/files.dart'; diff --git a/packages/neon/neon_files/pubspec.yaml b/packages/neon/neon_files/pubspec.yaml index 05974d74..51948faf 100644 --- a/packages/neon/neon_files/pubspec.yaml +++ b/packages/neon/neon_files/pubspec.yaml @@ -36,6 +36,7 @@ dependencies: queue: ^3.0.0 rxdart: ^0.27.0 share_plus: ^7.0.0 + universal_io: ^2.0.0 dev_dependencies: build_runner: ^2.4.6