refactor: Dialog BuildContext
This commit is contained in:
parent
40003628b9
commit
315a43c1a4
24 changed files with 30 additions and 68 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue