fix: Image viewer routing
This commit is contained in:
parent
18abb21cdb
commit
1701384350
3 changed files with 17 additions and 28 deletions
|
|
@ -4,18 +4,9 @@ import 'package:flutter/foundation.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
import 'matrix_file_extension.dart';
|
||||
import '../../pages/image_viewer.dart';
|
||||
import '../../widgets/matrix.dart';
|
||||
|
||||
extension LocalizedBody on Event {
|
||||
void openFile(BuildContext context, {bool downloadOnly = false}) async {
|
||||
if (!downloadOnly &&
|
||||
[MessageTypes.Image, MessageTypes.Sticker].contains(messageType)) {
|
||||
await Navigator.of(Matrix.of(context).navigatorContext).push(
|
||||
MaterialPageRoute(builder: (_) => ImageViewer(this)),
|
||||
);
|
||||
return;
|
||||
}
|
||||
void openFile(BuildContext context) async {
|
||||
final matrixFile = await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () => downloadAndDecryptAttachmentCached(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue