Skip to content

Commit

Permalink
fix: android file open
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie committed Dec 2, 2023
1 parent 2f2393a commit 2d4bdea
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ class ExtensionView extends GetView<ExtensionController> {
children: [
TextButton.icon(
onPressed: () {
launchUrl(
Uri.parse(
'https://github.com/search?q=topic%3Agopeed-extension&type=repositories'),
mode: LaunchMode.externalApplication);
launchUrl(Uri.parse(
'https://github.com/search?q=topic%3Agopeed-extension&type=repositories'));
},
icon: const Icon(Icons.search),
label: Text('extensionFind'.tr),
Expand All @@ -53,8 +51,7 @@ class ExtensionView extends GetView<ExtensionController> {
TextButton.icon(
onPressed: () {
launchUrl(
Uri.parse('https://docs.gopeed.com/dev-extension.html'),
mode: LaunchMode.externalApplication);
Uri.parse('https://docs.gopeed.com/dev-extension.html'));
},
icon: const Icon(Icons.edit),
label: Text('extensionDevelop'.tr),
Expand Down
13 changes: 9 additions & 4 deletions ui/flutter/lib/app/modules/task/views/task_files_view.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:open_file/open_file.dart';
import 'package:open_filex/open_filex.dart';
import 'package:path/path.dart';
import 'package:share_plus/share_plus.dart';
import 'package:url_launcher/url_launcher.dart';
Expand Down Expand Up @@ -67,7 +67,7 @@ class TaskFilesView extends GetView<TaskFilesController> {
return ListTile(
leading: file.isDirectory
? const Icon(Icons.folder)
: Icon(FaIcons.allIcons[findIcon(file.name)]),
: Icon(FaIcons.allIcons[findIcon(fileName)]),
title: Text(fileName),
subtitle: file.isDirectory
? Text('items'.trParams({
Expand Down Expand Up @@ -105,8 +105,13 @@ class TaskFilesView extends GetView<TaskFilesController> {
: [
IconButton(
icon: const Icon(Icons.play_circle),
onPressed: () {
OpenFile.open(filePath);
onPressed: () async {
print(filePath);
try {
await OpenFilex.open(filePath);
} catch (e) {
print(e);
}
}),
IconButton(
icon: const Icon(Icons.share),
Expand Down
54 changes: 23 additions & 31 deletions ui/flutter/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.18.0"
version: "1.17.1"
context_menus:
dependency: "direct main"
description:
Expand Down Expand Up @@ -441,10 +441,10 @@ packages:
dependency: transitive
description:
name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.18.1"
version: "0.18.0"
io:
dependency: transitive
description:
Expand Down Expand Up @@ -537,18 +537,18 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.16"
version: "0.12.15"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.5.0"
version: "0.2.0"
math_expressions:
dependency: transitive
description:
Expand All @@ -569,10 +569,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.0"
version: "1.9.1"
mime:
dependency: transitive
description:
Expand All @@ -581,14 +581,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.4"
open_file:
open_filex:
dependency: "direct main"
description:
name: open_file
sha256: a5a32d44acb7c899987d0999e1e3cbb0a0f1adebbf41ac813ec6d2d8faa0af20
name: open_filex
sha256: a6c95237767c5647e68b71a476602fcf4f1bfc530c126265e53addae22ef5fc2
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.3.2"
version: "4.3.4"
package_config:
dependency: transitive
description:
Expand Down Expand Up @@ -894,10 +894,10 @@ packages:
dependency: transitive
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.0"
version: "1.9.1"
sprintf:
dependency: transitive
description:
Expand All @@ -910,18 +910,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.11.1"
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.2"
version: "2.1.1"
stream_transform:
dependency: transitive
description:
Expand Down Expand Up @@ -958,10 +958,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.1"
version: "0.5.1"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -1083,14 +1083,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
web:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
web_socket_channel:
dependency: transitive
description:
Expand Down Expand Up @@ -1148,5 +1140,5 @@ packages:
source: hosted
version: "2.1.1"
sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
dart: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
2 changes: 1 addition & 1 deletion ui/flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ dependencies:
ref: fix/libayatana-set-icon-deprecation
autoscale_tabbarview: ^1.0.2
share_plus: ^7.1.0
open_file: ^3.3.2
flutter_form_builder: ^9.1.1
form_builder_validators: ^9.0.0
flutter_foreground_task: ^6.1.2
open_filex: ^4.3.4
dev_dependencies:
flutter_test:
sdk: flutter
Expand Down

0 comments on commit 2d4bdea

Please sign in to comment.