Implement image viewer
This commit is contained in:
parent
7d1358228e
commit
0276a81173
6 changed files with 112 additions and 40 deletions
|
|
@ -1,9 +1,7 @@
|
|||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluffychat/utils/matrix_file_extension.dart';
|
||||
import 'package:fluffychat/utils/event_extension.dart';
|
||||
import 'dialogs/simple_dialogs.dart';
|
||||
|
||||
class MessageDownloadContent extends StatelessWidget {
|
||||
final Event event;
|
||||
|
|
@ -20,21 +18,16 @@ class MessageDownloadContent extends StatelessWidget {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
RaisedButton(
|
||||
color: Colors.blueGrey,
|
||||
child: Text(
|
||||
L10n.of(context).downloadFile,
|
||||
overflow: TextOverflow.fade,
|
||||
softWrap: false,
|
||||
maxLines: 1,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
onPressed: () async {
|
||||
final MatrixFile matrixFile =
|
||||
await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
event.downloadAndDecryptAttachment(),
|
||||
);
|
||||
matrixFile.open();
|
||||
}),
|
||||
color: Colors.blueGrey,
|
||||
child: Text(
|
||||
L10n.of(context).downloadFile,
|
||||
overflow: TextOverflow.fade,
|
||||
softWrap: false,
|
||||
maxLines: 1,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
onPressed: () => event.openFile(context),
|
||||
),
|
||||
Text(
|
||||
'- ' +
|
||||
(event.content.containsKey('filename')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue