chore: Follow up imageviewer
This commit is contained in:
parent
838dcb413e
commit
6866a996a3
2 changed files with 9 additions and 4 deletions
|
|
@ -60,7 +60,10 @@ class ImageBubble extends StatelessWidget {
|
|||
if (!tapToView) return;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => ImageViewer(event),
|
||||
builder: (_) => ImageViewer(
|
||||
event,
|
||||
outerContext: context,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@ import '../../utils/matrix_sdk_extensions/event_extension.dart';
|
|||
|
||||
class ImageViewer extends StatefulWidget {
|
||||
final Event event;
|
||||
final BuildContext outerContext;
|
||||
|
||||
const ImageViewer(this.event, {super.key});
|
||||
const ImageViewer(this.event, {required this.outerContext, super.key});
|
||||
|
||||
@override
|
||||
ImageViewerController createState() => ImageViewerController();
|
||||
|
|
@ -20,8 +21,9 @@ class ImageViewer extends StatefulWidget {
|
|||
class ImageViewerController extends State<ImageViewer> {
|
||||
/// Forward this image to another room.
|
||||
void forwardAction() {
|
||||
Matrix.of(context).shareContent = widget.event.content;
|
||||
context.go('/rooms');
|
||||
Matrix.of(widget.outerContext).shareContent = widget.event.content;
|
||||
Navigator.of(context).pop();
|
||||
widget.outerContext.go('/rooms');
|
||||
}
|
||||
|
||||
/// Save this file with a system call.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue