chore: defaultly save files on Android

- defaultly save files on Android instead of share
- add dedicated share button for files and images on Android
- use ListTile instead of row to display file event
- update file_picker_cross

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
TheOneWithTheBraid 2022-04-30 17:43:38 +02:00
commit 49caad00c0
9 changed files with 137 additions and 68 deletions

View file

@ -28,6 +28,9 @@ class ImageViewerController extends State<ImageViewer> {
/// Save this file with a system call.
void saveFileAction() => widget.event.saveFile(context);
/// Save this file with a system call.
void shareFileAction() => widget.event.shareFile(context);
static const maxScaleFactor = 1.5;
/// Go back if user swiped it away

View file

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:fluffychat/pages/chat/events/image_bubble.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'image_viewer.dart';
class ImageViewerView extends StatelessWidget {
@ -37,6 +38,13 @@ class ImageViewerView extends StatelessWidget {
color: Colors.white,
tooltip: L10n.of(context)!.downloadFile,
),
if (PlatformInfos.isAndroid)
IconButton(
onPressed: controller.shareFileAction,
tooltip: L10n.of(context)!.share,
color: Colors.white,
icon: const Icon(Icons.share),
)
],
),
body: InteractiveViewer(