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

View File

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

View File

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