Update sdk for performance increases

This commit is contained in:
Sorunome 2020-07-02 09:30:59 +00:00 committed by Christian Pauly
commit e924908d49
10 changed files with 23 additions and 19 deletions

View file

@ -190,7 +190,7 @@ class _ChatState extends State<_Chat> {
if (file == null) return;
await SimpleDialogs(context).tryRequestWithLoadingDialog(
room.sendFileEvent(
MatrixFile(bytes: file.bytes, path: file.path),
MatrixFile(bytes: file.bytes, name: file.path),
),
);
}
@ -203,8 +203,8 @@ class _ChatState extends State<_Chat> {
maxHeight: 1600);
if (file == null) return;
await SimpleDialogs(context).tryRequestWithLoadingDialog(
room.sendImageEvent(
MatrixFile(bytes: await file.bytes, path: file.path),
room.sendFileEvent(
MatrixImageFile(bytes: await file.bytes, name: file.path),
),
);
}
@ -217,8 +217,8 @@ class _ChatState extends State<_Chat> {
maxHeight: 1600);
if (file == null) return;
await SimpleDialogs(context).tryRequestWithLoadingDialog(
room.sendImageEvent(
MatrixFile(bytes: file.bytes, path: file.path),
room.sendFileEvent(
MatrixImageFile(bytes: file.bytes, name: file.path),
),
);
}
@ -233,8 +233,9 @@ class _ChatState extends State<_Chat> {
if (result == null) return;
final audioFile = File(result);
await SimpleDialogs(context).tryRequestWithLoadingDialog(
room.sendAudioEvent(
MatrixFile(bytes: audioFile.readAsBytesSync(), path: audioFile.path),
room.sendFileEvent(
MatrixAudioFile(
bytes: audioFile.readAsBytesSync(), name: audioFile.path),
),
);
}

View file

@ -111,7 +111,7 @@ class _ChatDetailsState extends State<ChatDetails> {
widget.room.setAvatar(
MatrixFile(
bytes: tempFile.bytes,
path: tempFile.path,
name: tempFile.path,
),
),
);

View file

@ -137,7 +137,7 @@ class _ChatListState extends State<ChatList> {
'msgtype': 'chat.fluffy.shared_file',
'file': MatrixFile(
bytes: file.readAsBytesSync(),
path: file.path,
name: file.path,
),
};
}

View file

@ -99,7 +99,7 @@ class _SettingsState extends State<Settings> {
matrix.client.setAvatar(
MatrixFile(
bytes: tempFile.bytes,
path: tempFile.path,
name: tempFile.path,
),
),
);

View file

@ -374,13 +374,13 @@ class _EmoteImagePickerState extends State<_EmoteImagePicker> {
maxWidth: 128,
maxHeight: 128);
if (file == null) return;
final matrixFile = MatrixFile(bytes: file.bytes, path: file.path);
final matrixFile = MatrixFile(bytes: file.bytes, name: file.path);
final uploadResp =
await SimpleDialogs(context).tryRequestWithLoadingDialog(
Matrix.of(context)
.client
.api
.upload(matrixFile.bytes, matrixFile.path),
.upload(matrixFile.bytes, matrixFile.name),
);
setState(() {
widget.controller.text = uploadResp;

View file

@ -101,7 +101,7 @@ class _SignUpPasswordState extends State<SignUpPassword> {
await matrix.client.setAvatar(
MatrixFile(
bytes: widget.avatar.bytes,
path: widget.avatar.path,
name: widget.avatar.path,
),
);
} catch (exception) {