fix: Send file

This commit is contained in:
Christian Pauly 2021-01-18 10:43:00 +01:00
commit 77020d6b91
5 changed files with 25 additions and 22 deletions

View file

@ -214,12 +214,13 @@ class _ChatState extends State<Chat> {
if (result == null) return;
await showDialog(
context: context,
builder: (context) => SendFileDialog(
builder: (c) => SendFileDialog(
file: MatrixFile(
bytes: result.toUint8List(),
name: result.fileName,
).detectFileType,
room: room,
l10n: L10n.of(context),
),
);
}
@ -230,12 +231,13 @@ class _ChatState extends State<Chat> {
if (result == null) return;
await showDialog(
context: context,
builder: (context) => SendFileDialog(
builder: (c) => SendFileDialog(
file: MatrixImageFile(
bytes: result.toUint8List(),
name: result.fileName,
),
room: room,
l10n: L10n.of(context),
),
);
}
@ -246,12 +248,13 @@ class _ChatState extends State<Chat> {
final bytes = await file.readAsBytes();
await showDialog(
context: context,
builder: (context) => SendFileDialog(
builder: (c) => SendFileDialog(
file: MatrixImageFile(
bytes: bytes,
name: file.path,
),
room: room,
l10n: L10n.of(context),
),
);
}