-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add YaruMasterDetailPage.orientationOf()
and appBarBuilder
#642
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool, LGFM 👍
you just need to fix a missing comma
@Feichtmeier does this help with the back button issue? i have a feeling it doesn't because if |
ah you mean because return Column(
children: [
appBar,
Expanded(
child: YaruMasterDetailPage(
```
?
Well i don't know how to get this layout otherwise. Should I wrap it in a scaffold? |
I'm still trying to understand the requirements. :) The original question was how to query MD orientation and this PR adds that mechanism but I'm afraid it's not possible to access an inherited widget from where you'd like to, above the master detail page. We could make it possible to query the current orientation from the controller, though. class YaruMasterDetailController extends YaruPageController {
Orientation get orientation => ...
} |
Sounds enough for my case. But is this layout really so weird? 😄 Alternatively I could maybe wrap it in a scaffold? |
It's not the layout being weird or you doing anything wrong. We definitely want to support the layout you have. It's just impossible in Flutter to access an inherited widget from the context above so we need to make it possible to get the information in some other way. Scaffold(
appBar: YaruWindowTitleBar(
// context OUTSIDE YaruMasterDetailPage
// - Navigator.of(context) finds the ROOT navigator, not the MD navigator
// - YaruMasterDetailPage.of(context) doesn't find anything
),
body: YaruMasterDetailPage(
pageBuilder: (context, index) {
// context INSIDE YaruMasterDetailPage
// - Navigator.of(context) finds the MD navigator
// - YaruMasterDetailPage.of(context) is OK
},
),
) |
ah right! |
confirming. as the element is not reachable from down there |
@Jupi007 @Feichtmeier do we have any use case for this? |
Imo, this can be useful in some situations. |
Thanks for chiming in. I started feeling somehow unsure because this didn't solve the original issue. :) |
No description provided.