chore: Follow up fix ios share files

This commit is contained in:
Christian Pauly 2022-05-05 09:13:54 +02:00
parent 23652c99be
commit 2c8a1803cf
2 changed files with 13 additions and 10 deletions

View File

@ -32,19 +32,19 @@ class ImageViewerView extends StatelessWidget {
color: Colors.white,
tooltip: L10n.of(context)!.share,
),
IconButton(
icon: const Icon(Icons.download_outlined),
onPressed: controller.saveFileAction,
color: Colors.white,
tooltip: L10n.of(context)!.downloadFile,
),
if (PlatformInfos.isAndroid)
IconButton(
onPressed: controller.shareFileAction,
tooltip: L10n.of(context)!.share,
icon: const Icon(Icons.download_outlined),
onPressed: controller.saveFileAction,
color: Colors.white,
icon: const Icon(Icons.share),
)
tooltip: L10n.of(context)!.downloadFile,
),
IconButton(
onPressed: controller.shareFileAction,
tooltip: L10n.of(context)!.share,
color: Colors.white,
icon: const Icon(Icons.share),
)
],
),
body: InteractiveViewer(

View File

@ -12,6 +12,9 @@ import 'package:fluffychat/utils/platform_infos.dart';
extension MatrixFileExtension on MatrixFile {
void save(BuildContext context) async {
if (PlatformInfos.isIOS) {
return share(context);
}
final fileName = name.split('/').last;
final file = FilePickerCross(bytes);