mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-03-11 21:35:32 +00:00
fixed ShareX for iPad
https://github.com/fluttercommunity/plus_plugins/tree/main/packages/share_plus/share_plus#ipad
This commit is contained in:
parent
da7161e199
commit
790519fcae
7 changed files with 73 additions and 26 deletions
|
|
@ -2255,13 +2255,22 @@ mp.register_script_message('call_button_${button.id}_long', button${button.id}lo
|
|||
format: "image/png",
|
||||
includeLibassSubtitles: _includeSubtitles,
|
||||
);
|
||||
await Share.shareXFiles([
|
||||
XFile.fromData(
|
||||
imageBytes!,
|
||||
name: name,
|
||||
mimeType: 'image/png',
|
||||
),
|
||||
]);
|
||||
if (context.mounted) {
|
||||
final box =
|
||||
context.findRenderObject() as RenderBox?;
|
||||
await Share.shareXFiles(
|
||||
[
|
||||
XFile.fromData(
|
||||
imageBytes!,
|
||||
name: name,
|
||||
mimeType: 'image/png',
|
||||
),
|
||||
],
|
||||
sharePositionOrigin:
|
||||
box!.localToGlobal(Offset.zero) &
|
||||
box.size,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
button(
|
||||
|
|
|
|||
|
|
@ -654,7 +654,14 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
);
|
||||
final url =
|
||||
"${source!.baseUrl}${widget.manga!.link!.getUrlWithoutDomain}";
|
||||
Share.share(url);
|
||||
final box =
|
||||
context.findRenderObject() as RenderBox?;
|
||||
Share.share(
|
||||
url,
|
||||
sharePositionOrigin:
|
||||
box!.localToGlobal(Offset.zero) &
|
||||
box.size,
|
||||
);
|
||||
break;
|
||||
case 3:
|
||||
context.push("/migrate", extra: widget.manga);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class ChapterPageDownload extends ConsumerWidget {
|
|||
ref.read(downloadChapterProvider(chapter: chapter, useWifi: useWifi));
|
||||
}
|
||||
|
||||
void _sendFile() async {
|
||||
void _sendFile(BuildContext context) async {
|
||||
final storageProvider = StorageProvider();
|
||||
final mangaDir = await storageProvider.getMangaMainDirectory(chapter);
|
||||
final path = await storageProvider.getMangaChapterDirectory(
|
||||
|
|
@ -52,8 +52,13 @@ class ChapterPageDownload extends ConsumerWidget {
|
|||
} else {
|
||||
files = path!.listSync().map((e) => XFile(e.path)).toList();
|
||||
}
|
||||
if (files.isNotEmpty) {
|
||||
Share.shareXFiles(files, text: chapter.name);
|
||||
if (files.isNotEmpty && context.mounted) {
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
Share.shareXFiles(
|
||||
files,
|
||||
text: chapter.name,
|
||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +128,7 @@ class ChapterPageDownload extends ConsumerWidget {
|
|||
),
|
||||
onSelected: (value) {
|
||||
if (value == 0) {
|
||||
_sendFile();
|
||||
_sendFile(context);
|
||||
} else if (value == 1) {
|
||||
_deleteFile(download.id!);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -401,13 +401,21 @@ class _MangaChapterPageGalleryState
|
|||
context.l10n.share,
|
||||
Icons.share_outlined,
|
||||
() async {
|
||||
await Share.shareXFiles([
|
||||
XFile.fromData(
|
||||
imageBytes,
|
||||
name: name,
|
||||
mimeType: 'image/png',
|
||||
),
|
||||
]);
|
||||
if (context.mounted) {
|
||||
final box =
|
||||
context.findRenderObject() as RenderBox?;
|
||||
await Share.shareXFiles(
|
||||
[
|
||||
XFile.fromData(
|
||||
imageBytes,
|
||||
name: name,
|
||||
mimeType: 'image/png',
|
||||
),
|
||||
],
|
||||
sharePositionOrigin:
|
||||
box!.localToGlobal(Offset.zero) & box.size,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
button(
|
||||
|
|
|
|||
|
|
@ -93,9 +93,16 @@ class AboutScreen extends ConsumerWidget {
|
|||
ClipboardData(text: file.path),
|
||||
);
|
||||
}
|
||||
Share.shareXFiles([
|
||||
XFile(file.path),
|
||||
], text: "log.txt");
|
||||
if (context.mounted) {
|
||||
final box =
|
||||
context.findRenderObject() as RenderBox?;
|
||||
Share.shareXFiles(
|
||||
[XFile(file.path)],
|
||||
text: "log.txt",
|
||||
sharePositionOrigin:
|
||||
box!.localToGlobal(Offset.zero) & box.size,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
botToast(l10n.no_app_logs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,9 +176,13 @@ Future<void> doBackUp(
|
|||
alignment: Alignment.topLeft,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
Share.shareXFiles([
|
||||
XFile(p.join(path, "$name.backup")),
|
||||
], text: "$name.backup");
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
Share.shareXFiles(
|
||||
[XFile(p.join(path, "$name.backup"))],
|
||||
text: "$name.backup",
|
||||
sharePositionOrigin:
|
||||
box!.localToGlobal(Offset.zero) & box.size,
|
||||
);
|
||||
},
|
||||
child: Text(context.l10n.share),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -239,7 +239,14 @@ class _MangaWebViewState extends ConsumerState<MangaWebView> {
|
|||
if (value == 0) {
|
||||
_webViewController?.reload();
|
||||
} else if (value == 1) {
|
||||
Share.share(_url);
|
||||
final box =
|
||||
context.findRenderObject() as RenderBox?;
|
||||
Share.share(
|
||||
_url,
|
||||
sharePositionOrigin:
|
||||
box!.localToGlobal(Offset.zero) &
|
||||
box.size,
|
||||
);
|
||||
} else if (value == 2) {
|
||||
await InAppBrowser.openWithSystemBrowser(
|
||||
url: WebUri(_url),
|
||||
|
|
|
|||
Loading…
Reference in a new issue