fix: android sftp downloaded files share failed

This commit is contained in:
lollipopkit
2023-02-21 17:32:22 +08:00
parent 2986f80f89
commit 69fae4dd21
3 changed files with 10 additions and 9 deletions

View File

@@ -21,10 +21,13 @@ import 'data/provider/snippet.dart';
import 'data/provider/virtual_keyboard.dart'; import 'data/provider/virtual_keyboard.dart';
import 'locator.dart'; import 'locator.dart';
late final DebugProvider _debug;
Future<void> initApp() async { Future<void> initApp() async {
await initHive(); await initHive();
await setupLocator(); await setupLocator();
_debug = locator<DebugProvider>();
locator<SnippetProvider>().loadData(); locator<SnippetProvider>().loadData();
locator<PrivateKeyProvider>().loadData(); locator<PrivateKeyProvider>().loadData();
@@ -51,8 +54,7 @@ void runInZone(dynamic Function() body) {
// `setState() or markNeedsBuild() called during build` // `setState() or markNeedsBuild() called during build`
// error. // error.
Future.delayed(const Duration(milliseconds: 1), () { Future.delayed(const Duration(milliseconds: 1), () {
final debugProvider = locator<DebugProvider>(); _debug.addText(line);
debugProvider.addText(line);
}); });
}, },
); );
@@ -66,14 +68,13 @@ void runInZone(dynamic Function() body) {
void onError(Object obj, StackTrace stack) { void onError(Object obj, StackTrace stack) {
Analysis.recordException(obj); Analysis.recordException(obj);
final debugProvider = locator<DebugProvider>(); _debug.addMultiline(obj, Colors.red);
debugProvider.addMultiline(obj, Colors.red); _debug.addMultiline(stack, Colors.white);
debugProvider.addMultiline(stack, Colors.white);
} }
Future<void> main() async { Future<void> main() async {
await initApp();
runInZone(() async { runInZone(() async {
await initApp();
runApp( runApp(
MultiProvider( MultiProvider(
providers: [ providers: [

View File

@@ -746,10 +746,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: share_plus name: share_plus
sha256: e387077716f80609bb979cd199331033326033ecd1c8f200a90c5f57b1c9f55e sha256: "8c6892037b1824e2d7e8f59d54b3105932899008642e6372e5079c6939b4b625"
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "6.3.0" version: "6.3.1"
share_plus_platform_interface: share_plus_platform_interface:
dependency: transitive dependency: transitive
description: description:

View File

@@ -50,7 +50,7 @@ dependencies:
r_upgrade: ^0.3.6 r_upgrade: ^0.3.6
path_provider: ^2.0.9 path_provider: ^2.0.9
easy_isolate: ^1.3.0 easy_isolate: ^1.3.0
share_plus: ^6.3.0 share_plus: ^6.3.1
intl: ^0.17.0 intl: ^0.17.0
share_plus_web: ^3.1.0 share_plus_web: ^3.1.0
# xterm: ^3.4.1 # xterm: ^3.4.1