mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-17 13:53:41 +00:00
fix: upgrade to race-safe dart_ipc (#1479)
This commit is contained in:
14 files changed
+136
-79
No files matched your search
@@ -763,15 +763,10 @@ class _CreateTaskWindowPageState extends ConsumerState<CreateTaskWindowPage> {
|
||||
}
|
||||
|
||||
Future<void> _pickTorrentFile() async {
|
||||
final result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: const ['torrent'],
|
||||
withData: kIsWeb,
|
||||
);
|
||||
final file = result?.files.single;
|
||||
final file = await FilePicker.pickFile(type: FileType.custom, allowedExtensions: const ['torrent']);
|
||||
if (file == null) return;
|
||||
|
||||
await _applyTorrentFile(name: file.name, filePath: file.path, bytes: file.bytes);
|
||||
await _applyTorrentFile(name: file.name, filePath: file.path, readBytes: file.readAsBytes);
|
||||
}
|
||||
|
||||
Future<void> _handleDroppedTorrent(DropDoneDetails details) async {
|
||||
|
||||
@@ -109,7 +109,7 @@ class _TaskFileManagerViewState extends State<TaskFileManagerView> {
|
||||
try {
|
||||
final renderBox = actionContext.findRenderObject();
|
||||
final origin = renderBox is RenderBox ? renderBox.localToGlobal(Offset.zero) & renderBox.size : null;
|
||||
await Share.shareXFiles([XFile(_localPath(entry))], sharePositionOrigin: origin);
|
||||
await SharePlus.instance.share(ShareParams(files: [XFile(_localPath(entry))], sharePositionOrigin: origin));
|
||||
} catch (error) {
|
||||
if (mounted) showAppToast(context, error.toString(), type: AppToastType.error);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user