Revert "refactor: Dialog BuildContext"

This reverts commit 315a43c1a4.
This commit is contained in:
Krille 2024-01-25 09:13:08 +01:00
commit 3fa9c65a2b
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
24 changed files with 68 additions and 30 deletions

View file

@ -120,6 +120,7 @@ class UserBottomSheetController extends State<UserBottomSheet> {
);
if (score == null) return;
final reason = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.whyDoYouWantToReportThis,
okLabel: L10n.of(context)!.ok,
@ -149,12 +150,12 @@ class UserBottomSheetController extends State<UserBottomSheet> {
case UserBottomSheetAction.ban:
if (user == null) throw ('User must not be null for this action!');
if (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)!.banUserDescription,
isDestructiveAction: true,
) ==
OkCancelResult.ok) {
await showFutureLoadingDialog(
@ -167,6 +168,7 @@ class UserBottomSheetController extends State<UserBottomSheet> {
case UserBottomSheetAction.unban:
if (user == null) throw ('User must not be null for this action!');
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
@ -184,6 +186,7 @@ class UserBottomSheetController extends State<UserBottomSheet> {
case UserBottomSheetAction.kick:
if (user == null) throw ('User must not be null for this action!');
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
@ -207,6 +210,7 @@ class UserBottomSheetController extends State<UserBottomSheet> {
if (newPermission != null) {
if (newPermission == 100 &&
await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,