1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 22:39:22 +00:00

Add support for PDFs

This commit is contained in:
Pierre HUBERT 2019-11-16 09:24:20 +01:00
parent 527927da82
commit 1be499f242

View File

@ -177,6 +177,10 @@ class _PostTileState extends State<PostTile> {
postContent = _buildPostWebLink(); postContent = _buildPostWebLink();
break; break;
case PostKind.PDF:
postContent = _buildPostPDF();
break;
case PostKind.COUNTDOWN: case PostKind.COUNTDOWN:
postContent = _buildCountDownTimer(); postContent = _buildCountDownTimer();
break; break;
@ -325,6 +329,16 @@ class _PostTileState extends State<PostTile> {
); );
} }
Widget _buildPostPDF() {
return RaisedButton.icon(
onPressed: () {
launch(widget.post.fileURL);
},
icon: Icon(Icons.picture_as_pdf),
label: Text(tr("PDF")),
);
}
Widget _buildCountDownTimer() { Widget _buildCountDownTimer() {
return CountdownWidget( return CountdownWidget(
startTime: widget.post.timeSent, startTime: widget.post.timeSent,