mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-22 17:20:43 +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/image_bubble.dart';
|
||||||
import 'package:fluffychat/components/matrix.dart';
|
import 'package:fluffychat/components/matrix.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:photo_view/photo_view.dart';
|
|
||||||
import '../utils/event_extension.dart';
|
import '../utils/event_extension.dart';
|
||||||
|
|
||||||
class ImageView extends StatelessWidget {
|
class ImageView extends StatelessWidget {
|
||||||
@ -42,7 +41,7 @@ class ImageView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: PhotoView.customChild(
|
body: InteractiveViewer(
|
||||||
minScale: 1.0,
|
minScale: 1.0,
|
||||||
maxScale: 10.0,
|
maxScale: 10.0,
|
||||||
child: ImageBubble(
|
child: ImageBubble(
|
||||||
@ -55,6 +54,11 @@ class ImageView extends StatelessWidget {
|
|||||||
radius: 0.0,
|
radius: 0.0,
|
||||||
thumbnailOnly: false,
|
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"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.4"
|
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:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -34,7 +34,6 @@ dependencies:
|
|||||||
universal_html: ^1.2.3
|
universal_html: ^1.2.3
|
||||||
receive_sharing_intent: ^1.4.2
|
receive_sharing_intent: ^1.4.2
|
||||||
flutter_slidable: ^0.5.7
|
flutter_slidable: ^0.5.7
|
||||||
photo_view: ^0.10.3
|
|
||||||
flutter_sound: 2.1.1
|
flutter_sound: 2.1.1
|
||||||
open_file: ^3.0.3
|
open_file: ^3.0.3
|
||||||
mime_type: ^0.3.2
|
mime_type: ^0.3.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user