add offline attachment rendering

This commit is contained in:
Salvatore Giordano
2020-03-12 10:30:07 +01:00
parent fe5adc72dc
commit 6f696c41ed
2 changed files with 112 additions and 86 deletions
+5
View File
@@ -573,6 +573,10 @@ class _MessageInputState extends State<MessageInput> {
file = await FilePicker.getFile(type: type);
}
if (file == null) {
return;
}
final channel = StreamChannel.of(context).channel;
final bytes = await file.readAsBytes();
@@ -717,6 +721,7 @@ class _MessageInputState extends State<MessageInput> {
imageUrl: attachment.type == FileType.IMAGE ? attachment.url : null,
assetUrl: attachment.url,
type: type,
localUri: attachment.file.uri,
);
});
}