Browse Source

refactor(app,neon,neon_files,nextcloud): Use universal_io instead of dart:io

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/1039/head
jld3103 1 year ago
parent
commit
ecc0a4886e
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 3
      packages/app/integration_test/screenshot_test.dart
  2. 2
      packages/app/pubspec.lock
  3. 1
      packages/app/pubspec.yaml
  4. 2
      packages/neon/neon/lib/src/app.dart
  5. 3
      packages/neon/neon/lib/src/platform/linux.dart
  6. 2
      packages/neon/neon/lib/src/platform/platform.dart
  7. 3
      packages/neon/neon/lib/src/utils/global_options.dart
  8. 2
      packages/neon/neon/lib/src/utils/save_file.dart
  9. 2
      packages/neon/neon/lib/src/widgets/error.dart
  10. 1
      packages/neon/neon/pubspec.yaml
  11. 2
      packages/neon/neon_files/lib/neon_files.dart
  12. 1
      packages/neon/neon_files/pubspec.yaml
  13. 2
      packages/nextcloud/test/helper.dart
  14. 2
      packages/nextcloud/test/news_test.dart
  15. 2
      packages/nextcloud/test/webdav_test.dart

3
packages/app/integration_test/screenshot_test.dart

@ -1,5 +1,3 @@
import 'dart:io';
import 'package:app/apps.dart';
import 'package:app/branding.dart';
import 'package:flutter/material.dart';
@ -17,6 +15,7 @@ import 'package:nextcloud/nextcloud.dart';
import 'package:nextcloud/notes.dart' as notes;
import 'package:nextcloud/notifications.dart' as notifications;
import 'package:shared_preferences/shared_preferences.dart';
import 'package:universal_io/io.dart';
Future<void> runTestApp(
final WidgetTester tester,

2
packages/app/pubspec.lock

@ -1231,7 +1231,7 @@ packages:
source: hosted
version: "2.0.1"
universal_io:
dependency: transitive
dependency: "direct main"
description:
name: universal_io
sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad"

1
packages/app/pubspec.yaml

@ -33,6 +33,7 @@ dependencies:
git:
url: https://github.com/nextcloud/neon
path: packages/neon/neon_notifications
universal_io: any
vector_graphics: any
dev_dependencies:

2
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

3
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

2
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

3
packages/neon/neon/lib/src/utils/global_options.dart

@ -1,5 +1,3 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:neon/l10n/localizations.dart';
@ -10,6 +8,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';

2
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<String?> saveFileWithPickDialog(final String fileName, final Uint8List data) async {
if (NeonPlatform.instance.shouldUseFileDialog) {

2
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.
///

1
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

2
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';

1
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

2
packages/nextcloud/test/helper.dart

@ -1,12 +1,12 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:math';
import 'package:nextcloud/core.dart' as core;
import 'package:nextcloud/nextcloud.dart';
import 'package:process_run/cmd_run.dart';
import 'package:test/test.dart';
import 'package:universal_io/io.dart';
const retryCount = 3;
const timeout = Timeout(Duration(seconds: 30));

2
packages/nextcloud/test/news_test.dart

@ -1,9 +1,9 @@
import 'dart:async';
import 'dart:io';
import 'package:nextcloud/news.dart' as news;
import 'package:nextcloud/nextcloud.dart';
import 'package:test/test.dart';
import 'package:universal_io/io.dart';
import 'helper.dart';

2
packages/nextcloud/test/webdav_test.dart

@ -1,10 +1,10 @@
import 'dart:convert';
import 'dart:io';
import 'dart:math';
import 'dart:typed_data';
import 'package:nextcloud/nextcloud.dart';
import 'package:test/test.dart';
import 'package:universal_io/io.dart';
import 'helper.dart';

Loading…
Cancel
Save