Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fix(menu): Preferences… from the title-bar menu throws "Looking up a deactivated widget's ancestor is unsafe"

クローズ 初心者向け
#1,777 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
dart, flutter
領域
desktop, frontend

調査の方向性

lib/features/main_screen/querya_window_title_bar.dart、lib/shared/widgets/querya_context_menu.dart:58-67、lib/shared/widgets/app_dialog.dart:25を読み、メニューのコールバックのコンテキストがダイアログにどう渡るかをたどってください。実際のポインタークリックで問題を再現し、メニューを開いて項目をタップする、提案されたウィジェットテストを追加してください。非アクティブ化されたコンテキストに関するアサーションが発生せずにダイアログが開けば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

Problem

Choosing Edit → Preferences… in the title-bar menu throws in the scheduler callback (seen in a debug run, Linux):

Looking up a deactivated widget's ancestor is unsafe.
#3 Localizations.of
#6 MaterialLocalizations.of
#7 showAppDialog (lib/shared/widgets/app_dialog.dart:25)
#8 showPreferencesDialog (lib/features/settings/preferences_dialog.dart:30)
#9 QueryaWindowTitleBar.build.<anonymous closure> (lib/features/main_screen/querya_window_title_bar.dart:251)
#10 QueryaMenuItem.build.<anonymous closure> (lib/shared/widgets/querya_context_menu.dart:65)
#11 _MenuItemButtonState._handleSelect

QueryaMenuItem passes its own context to onPressed(ctx). By the time showAppDialog runs (the menu closes first, the call lands in a frame callback) that element is deactivated, so MaterialLocalizations.of(context) asserts. In a release build the assertion is off, so the symptom there is not known; it was not checked.

Not reproduced through a semantic tap (it calls onPressed before the menu closes); it needs a real pointer click. "Go to Object…" and the other items use the same ctx, so they may have the same problem; not checked.

Proposal

Open the dialog with a context that outlives the menu (the title bar's own context or the root navigator, as _dialogAnchorContext in connection_creation_flow.dart does), or give QueryaMenuItem a context that is still mounted. Add a widget test that opens a menu, taps the item and expects the dialog.

Where

  • lib/features/main_screen/querya_window_title_bar.dart (the onPressed: (ctx) => ... items)
  • lib/shared/widgets/querya_context_menu.dart:58-67
  • `lib/shared/widgets/app_dialog.dart:25
主要言語
Dart
スター
23
フォーク
1
平均マージ
49分
マージ済み PR(30日)
496

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

QueryaHub/Querya-Desktop のほかの issue

QueryaHub/Querya-Desktop の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。