|
|
@ -59,65 +59,45 @@ class MessageContent extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
case MessageTypes.Audio:
|
|
|
|
case MessageTypes.Audio:
|
|
|
|
|
|
|
|
case MessageTypes.Video:
|
|
|
|
|
|
|
|
case MessageTypes.File:
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
width: 200,
|
|
|
|
child: Column(
|
|
|
|
child: RaisedButton(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
color: Colors.blueGrey,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
child: Row(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
RaisedButton(
|
|
|
|
Icon(Icons.play_arrow, color: Colors.white),
|
|
|
|
color: Colors.blueGrey,
|
|
|
|
Text(
|
|
|
|
child: Text(
|
|
|
|
I18n.of(context).play(event.body),
|
|
|
|
I18n.of(context).downloadFile,
|
|
|
|
overflow: TextOverflow.fade,
|
|
|
|
overflow: TextOverflow.fade,
|
|
|
|
softWrap: false,
|
|
|
|
softWrap: false,
|
|
|
|
maxLines: 1,
|
|
|
|
maxLines: 1,
|
|
|
|
style: TextStyle(color: Colors.white),
|
|
|
|
style: TextStyle(color: Colors.white),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
onPressed: () => launch(
|
|
|
|
),
|
|
|
|
MxContent(event.content["url"])
|
|
|
|
onPressed: () => launch(MxContent(event.content["url"])
|
|
|
|
.getDownloadLink(event.room.client),
|
|
|
|
.getDownloadLink(event.room.client)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
if (event.sizeString != null)
|
|
|
|
case MessageTypes.Video:
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
|
|
|
width: 200,
|
|
|
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
|
|
|
color: Colors.blueGrey,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
Icon(Icons.play_arrow, color: Colors.white),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
I18n.of(context).play(event.body),
|
|
|
|
event.sizeString,
|
|
|
|
overflow: TextOverflow.fade,
|
|
|
|
style: TextStyle(
|
|
|
|
softWrap: false,
|
|
|
|
color: textColor,
|
|
|
|
maxLines: 1,
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
style: TextStyle(color: Colors.white),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
Text(
|
|
|
|
),
|
|
|
|
(event.content.containsKey("filename")
|
|
|
|
onPressed: () => launch(
|
|
|
|
? event.content["filename"]
|
|
|
|
MxContent(event.content["url"])
|
|
|
|
: event.body),
|
|
|
|
.getDownloadLink(event.room.client),
|
|
|
|
style: TextStyle(
|
|
|
|
),
|
|
|
|
color: textColor,
|
|
|
|
),
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
);
|
|
|
|
),
|
|
|
|
case MessageTypes.File:
|
|
|
|
),
|
|
|
|
return Container(
|
|
|
|
],
|
|
|
|
width: 200,
|
|
|
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
|
|
|
color: Colors.blueGrey,
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
I18n.of(context).download(event.body),
|
|
|
|
|
|
|
|
overflow: TextOverflow.fade,
|
|
|
|
|
|
|
|
softWrap: false,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
style: TextStyle(color: Colors.white),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onPressed: () => launch(
|
|
|
|
|
|
|
|
MxContent(event.content["url"])
|
|
|
|
|
|
|
|
.getDownloadLink(Matrix.of(context).client),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
case MessageTypes.BadEncrypted:
|
|
|
|
case MessageTypes.BadEncrypted:
|
|
|
|