fix: App crash on page navigation with open popup menu

This commit is contained in:
Christian Kußowski 2025-05-29 12:44:06 +02:00
parent 3078e9788f
commit 49780b01fe
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
8 changed files with 10 additions and 0 deletions

View file

@ -118,6 +118,7 @@ class ChatInputRow extends StatelessWidget {
decoration: const BoxDecoration(),
clipBehavior: Clip.hardEdge,
child: PopupMenuButton<String>(
useRootNavigator: true,
icon: const Icon(Icons.add_circle_outline),
iconColor: theme.colorScheme.onPrimaryContainer,
onSelected: controller.onAddPopupMenuButtonSelected,
@ -198,6 +199,7 @@ class ChatInputRow extends StatelessWidget {
decoration: const BoxDecoration(),
clipBehavior: Clip.hardEdge,
child: PopupMenuButton(
useRootNavigator: true,
icon: const Icon(Icons.camera_alt_outlined),
onSelected: controller.onAddPopupMenuButtonSelected,
iconColor: theme.colorScheme.onPrimaryContainer,
@ -365,6 +367,7 @@ class _ChatAccountPicker extends StatelessWidget {
child: FutureBuilder<Profile>(
future: controller.sendingClient.fetchOwnProfile(),
builder: (context, snapshot) => PopupMenuButton<String>(
useRootNavigator: true,
onSelected: (mxid) => _popupMenuButtonSelected(mxid, context),
itemBuilder: (BuildContext context) => clients
.map(

View file

@ -72,6 +72,7 @@ class ChatView extends StatelessWidget {
),
if (controller.selectedEvents.length == 1)
PopupMenuButton<_EventContextAction>(
useRootNavigator: true,
onSelected: (action) {
switch (action) {
case _EventContextAction.info:

View file

@ -162,6 +162,7 @@ class ClientChooserButton extends StatelessWidget {
borderRadius: BorderRadius.circular(99),
color: Colors.transparent,
child: PopupMenuButton<Object>(
useRootNavigator: true,
popUpAnimationStyle: FluffyThemes.isColumnMode(context)
? AnimationStyle.noAnimation
: null, // https://github.com/flutter/flutter/issues/167180

View file

@ -265,6 +265,7 @@ class _SpaceViewState extends State<SpaceView> {
),
actions: [
PopupMenuButton<SpaceActions>(
useRootNavigator: true,
onSelected: _onSpaceAction,
itemBuilder: (context) => [
PopupMenuItem(

View file

@ -35,6 +35,7 @@ class HomeserverPickerView extends StatelessWidget {
),
actions: [
PopupMenuButton<MoreLoginActions>(
useRootNavigator: true,
onSelected: controller.onMoreAction,
itemBuilder: (_) => [
PopupMenuItem(

View file

@ -29,6 +29,7 @@ class EmotesSettingsView extends StatelessWidget {
title: Text(L10n.of(context).customEmojisAndStickers),
actions: [
PopupMenuButton<PopupMenuEmojiActions>(
useRootNavigator: true,
onSelected: (value) {
switch (value) {
case PopupMenuEmojiActions.export:

View file

@ -52,6 +52,7 @@ class ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
children: [
const SizedBox.shrink(),
PopupMenuButton<ChatPopupMenuActions>(
useRootNavigator: true,
onSelected: (choice) async {
switch (choice) {
case ChatPopupMenuActions.leave:

View file

@ -36,6 +36,7 @@ class LogViewerState extends State<LogViewer> {
onPressed: () => setState(() => fontSize--),
),
PopupMenuButton<Level>(
useRootNavigator: true,
itemBuilder: (context) => Level.values
.map(
(level) => PopupMenuItem(