Skip to content

🐛 Can't open a Flyout with a navigatorKey #764

@WinXaito

Description

@WinXaito

I have a title bar like that:

image

This bar is outside the navigation and global to all page.

For this usage, I asked for #538 (thanks for that @bdlukaa)

After the upgrade of fluent_ui (from 4.1.5 to 4.4.1), I'm facing the following issue:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/rendering/object.dart': Failed assertion: line 2961 pos 14: 'renderer.parent != null': is not true.
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      RenderObject.getTransformTo (package:flutter/src/rendering/object.dart:2961:14)
#3      RenderBox.localToGlobal (package:flutter/src/rendering/box.dart:2661:39)
#4      FlyoutController.showFlyout (package:fluent_ui/src/controls/flyouts/flyout.dart:569:19)
#5      _ActionState.showMenu (package:dncui/src/controls/core/mw_window_caption.dart:190:16)

The problem is caused by this line (https://github.com/bdlukaa/fluent_ui/blob/master/lib/src/controls/flyouts/flyout.dart#L569 and line 572).

If I comment , ancestor: navigatorBox, that's work !

image

The code for open the flyout:

controller.showFlyout(
      navigatorKey: widget.action.navigationKey,
      builder: widget.action.flyoutBuilder!,
      position: position,
      placementMode: FlyoutPlacementMode.bottomRight,
      margin: 0,
      // additionalOffset: -kWindowCaptionHeight,
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions