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

@ -119,7 +119,6 @@ class _ImportEmoteArchiveDialogState extends State<ImportEmoteArchiveDialog> {
final completer = Completer<OkCancelResult>();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
final result = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.emoteExists,
message: imageCode,

View file

@ -138,7 +138,6 @@ class EmotesSettingsController extends State<EmotesSettings> {
if (pack!.images.keys.any((k) => k == imageCode && k != oldImageCode)) {
controller.text = oldImageCode;
showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.emoteExists,
okLabel: L10n.of(context)!.ok,
@ -148,7 +147,6 @@ class EmotesSettingsController extends State<EmotesSettings> {
if (!RegExp(r'^[-\w]+$').hasMatch(imageCode)) {
controller.text = oldImageCode;
showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.emoteInvalid,
okLabel: L10n.of(context)!.ok,
@ -184,7 +182,6 @@ class EmotesSettingsController extends State<EmotesSettings> {
if (newImageCodeController.text.isEmpty ||
newImageController.value == null) {
await showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.emoteWarnNeedToPick,
okLabel: L10n.of(context)!.ok,
@ -194,7 +191,6 @@ class EmotesSettingsController extends State<EmotesSettings> {
final imageCode = newImageCodeController.text;
if (pack!.images.containsKey(imageCode)) {
await showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.emoteExists,
okLabel: L10n.of(context)!.ok,
@ -203,7 +199,6 @@ class EmotesSettingsController extends State<EmotesSettings> {
}
if (!RegExp(r'^[-\w]+$').hasMatch(imageCode)) {
await showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.emoteInvalid,
okLabel: L10n.of(context)!.ok,
@ -310,7 +305,7 @@ class EmotesSettingsController extends State<EmotesSettings> {
await showDialog(
context: context,
// breaks [Matrix.of] calls otherwise
useRootNavigator: false,
builder: (context) => ImportEmoteArchiveDialog(
controller: this,
archive: archive,