Use SimpleDialogs

This commit is contained in:
Christian Pauly 2020-04-27 13:36:39 +02:00
commit 547aace85c
21 changed files with 119 additions and 111 deletions

View file

@ -182,7 +182,7 @@ class _ChatState extends State<_Chat> {
}
File file = await FilePicker.getFile();
if (file == null) return;
await matrix.tryRequestWithLoadingDialog(
await SimpleDialogs(context).tryRequestWithLoadingDialog(
room.sendFileEvent(
MatrixFile(bytes: await file.readAsBytes(), path: file.path),
),
@ -200,7 +200,7 @@ class _ChatState extends State<_Chat> {
maxWidth: 1600,
maxHeight: 1600);
if (file == null) return;
await matrix.tryRequestWithLoadingDialog(
await SimpleDialogs(context).tryRequestWithLoadingDialog(
room.sendImageEvent(
MatrixFile(bytes: await file.readAsBytes(), path: file.path),
),
@ -218,7 +218,7 @@ class _ChatState extends State<_Chat> {
maxWidth: 1600,
maxHeight: 1600);
if (file == null) return;
await matrix.tryRequestWithLoadingDialog(
await SimpleDialogs(context).tryRequestWithLoadingDialog(
room.sendImageEvent(
MatrixFile(bytes: await file.readAsBytes(), path: file.path),
),
@ -234,7 +234,7 @@ class _ChatState extends State<_Chat> {
));
if (result == null) return;
final File audioFile = File(result);
await Matrix.of(context).tryRequestWithLoadingDialog(
await SimpleDialogs(context).tryRequestWithLoadingDialog(
room.sendAudioEvent(
MatrixFile(bytes: audioFile.readAsBytesSync(), path: audioFile.path),
),
@ -265,7 +265,7 @@ class _ChatState extends State<_Chat> {
);
if (!confirmed) return;
for (Event event in selectedEvents) {
await Matrix.of(context).tryRequestWithLoadingDialog(
await SimpleDialogs(context).tryRequestWithLoadingDialog(
event.status > 0 ? event.redact() : event.remove());
}
setState(() => selectedEvents.clear());
@ -322,7 +322,7 @@ class _ChatState extends State<_Chat> {
matrix.activeRoomId = widget.id;
if (room.membership == Membership.invite) {
matrix.tryRequestWithLoadingDialog(room.join());
SimpleDialogs(context).tryRequestWithLoadingDialog(room.join());
}
String typingText = "";