mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-20 08:00:39 +01:00
feat: Implement interactive viewer
This commit is contained in:
parent
0b8cc24117
commit
22b3fc1d2f
@ -2,7 +2,6 @@ import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:fluffychat/components/image_bubble.dart';
|
||||
import 'package:fluffychat/components/matrix.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:photo_view/photo_view.dart';
|
||||
import '../utils/event_extension.dart';
|
||||
|
||||
class ImageView extends StatelessWidget {
|
||||
@ -42,7 +41,7 @@ class ImageView extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
body: PhotoView.customChild(
|
||||
body: InteractiveViewer(
|
||||
minScale: 1.0,
|
||||
maxScale: 10.0,
|
||||
child: ImageBubble(
|
||||
@ -55,6 +54,11 @@ class ImageView extends StatelessWidget {
|
||||
radius: 0.0,
|
||||
thumbnailOnly: false,
|
||||
),
|
||||
onInteractionEnd: (ScaleEndDetails endDetails) {
|
||||
if (endDetails.velocity.pixelsPerSecond.dy > 500.0) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -767,13 +767,6 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.4"
|
||||
photo_view:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: photo_view
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.10.3"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -34,7 +34,6 @@ dependencies:
|
||||
universal_html: ^1.2.3
|
||||
receive_sharing_intent: ^1.4.2
|
||||
flutter_slidable: ^0.5.7
|
||||
photo_view: ^0.10.3
|
||||
flutter_sound: 2.1.1
|
||||
open_file: ^3.0.3
|
||||
mime_type: ^0.3.2
|
||||
|
Loading…
x
Reference in New Issue
Block a user