mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-23 20:49:26 +01:00
Merge branch 'krille/fix-ios-share' into 'main'
chore: Follow up fix ios share files See merge request famedly/fluffychat!859
This commit is contained in:
commit
0d3b192f8f
@ -25,7 +25,6 @@ class ChatListViewBody extends StatefulWidget {
|
||||
class _ChatListViewBodyState extends State<ChatListViewBody> {
|
||||
// the matrix sync stream
|
||||
late StreamSubscription _subscription;
|
||||
late StreamSubscription _clientSubscription;
|
||||
|
||||
// used to check the animation direction
|
||||
String? _lastUserId;
|
||||
@ -40,8 +39,6 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
|
||||
.where((s) => s.hasRoomUpdate)
|
||||
.rateLimit(const Duration(seconds: 1))
|
||||
.listen((d) => setState(() {}));
|
||||
_clientSubscription =
|
||||
widget.controller.clientStream.listen((d) => setState(() {}));
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@ -194,7 +191,6 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
|
||||
@override
|
||||
void dispose() {
|
||||
_subscription.cancel();
|
||||
_clientSubscription.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user