refactor: Dialog BuildContext

This commit is contained in:
krille-chan 2024-01-20 08:35:09 +01:00
commit 315a43c1a4
No known key found for this signature in database
24 changed files with 30 additions and 68 deletions

View file

@ -176,7 +176,6 @@ class ChatListController extends State<ChatList>
void setServer() async {
final newServer = await showTextInputDialog(
useRootNavigator: false,
title: L10n.of(context)!.changeTheHomeserver,
context: context,
okLabel: L10n.of(context)!.ok,
@ -473,12 +472,12 @@ class ChatListController extends State<ChatList>
Future<void> archiveAction() async {
final confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.cancel,
message: L10n.of(context)!.archiveRoomDescription,
isDestructiveAction: true,
) ==
OkCancelResult.ok;
if (!confirmed) return;
@ -493,7 +492,6 @@ class ChatListController extends State<ChatList>
final client = Matrix.of(context).client;
final currentPresence = await client.fetchCurrentPresence(client.userID!);
final input = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.setStatus,
message: L10n.of(context)!.leaveEmptyToClearStatus,

View file

@ -118,7 +118,6 @@ class ChatListItem extends StatelessWidget {
shareFile != null) {
await showDialog(
context: context,
useRootNavigator: false,
builder: (c) => SendFileDialog(
files: [shareFile],
room: room,
@ -160,12 +159,12 @@ class ChatListItem extends StatelessWidget {
return;
}
final confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.no,
message: L10n.of(context)!.archiveRoomDescription,
isDestructiveAction: true,
);
if (confirmed == OkCancelResult.cancel) return;
await showFutureLoadingDialog(