-
-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Can't open a Flyout with a navigatorKey #764
Comments
If ancestor is not provided, the position of the flyout is likely to be incorrect in a nested Navigator context (using From the documentation of the
This is what it looks like if the ExpectedActualOn the other hand, if the Navigator is not a parent of the Your code may need to be updated to support a global navigator context |
Yeah, I tried to create a new My tree: The app bar is builded like that: return FluentApp(
...
builder: (context, child) {
return CoreView(
child: child ?? const Text('internal error'),
...
);
},
); The appbar is constructed in the Maybe we can add the possibility to pass a custom navigator ancestor (aka pass à
I have one, but because my AppBar is not routed, that doesn't work.. And I don't know how to do that differently. |
In fact, I found the problem. You calculate the position with the ancestor like that: final targetBox = context.findRenderObject() as RenderBox;
final targetSize = targetBox.size;
final targetOffset =
targetBox.localToGlobal(Offset.zero/*, ancestor: navigatorBox*/) +
Offset(0, targetSize.height);
final targetRect =
targetBox.localToGlobal(Offset.zero/*, ancestor: navigatorBox*/) &
targetSize; But I give him the position manually, so the position is used like that: targetOffset: position ?? targetOffset, Si for resolve this problem, we simply must don't calculate the If you are ok with that, I will make a PR. - Edit: see #768 |
I have a title bar like that:
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:
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 !The code for open the flyout:
The text was updated successfully, but these errors were encountered: