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

@ -120,7 +120,6 @@ 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,
@ -150,12 +149,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(
@ -168,7 +167,6 @@ 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,
@ -186,7 +184,6 @@ 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,
@ -210,7 +207,6 @@ 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,