fix: send images as images, not files
This commit is contained in:
parent
1d5607f9c5
commit
751dcb7600
|
@ -227,7 +227,7 @@ class _ChatState extends State<_Chat> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendImageAction(BuildContext context) async {
|
void sendImageAction(BuildContext context) async {
|
||||||
MatrixFile file;
|
MatrixImageFile file;
|
||||||
if (PlatformInfos.isMobile) {
|
if (PlatformInfos.isMobile) {
|
||||||
final result = await ImagePicker().getImage(
|
final result = await ImagePicker().getImage(
|
||||||
source: ImageSource.gallery,
|
source: ImageSource.gallery,
|
||||||
|
@ -235,7 +235,7 @@ class _ChatState extends State<_Chat> {
|
||||||
maxWidth: 1600,
|
maxWidth: 1600,
|
||||||
maxHeight: 1600);
|
maxHeight: 1600);
|
||||||
if (result == null) return;
|
if (result == null) return;
|
||||||
file = MatrixFile(
|
file = MatrixImageFile(
|
||||||
bytes: await result.readAsBytes(),
|
bytes: await result.readAsBytes(),
|
||||||
name: result.path,
|
name: result.path,
|
||||||
);
|
);
|
||||||
|
@ -243,7 +243,7 @@ class _ChatState extends State<_Chat> {
|
||||||
final result =
|
final result =
|
||||||
await FilePickerCross.importFromStorage(type: FileTypeCross.image);
|
await FilePickerCross.importFromStorage(type: FileTypeCross.image);
|
||||||
if (result == null) return;
|
if (result == null) return;
|
||||||
file = MatrixFile(
|
file = MatrixImageFile(
|
||||||
bytes: result.toUint8List(),
|
bytes: result.toUint8List(),
|
||||||
name: result.fileName,
|
name: result.fileName,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue