-
Notifications
You must be signed in to change notification settings - Fork 38
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
fix(YaruMasterTile): let onTap override scope ontap #738
Conversation
What's the problem you're trying to solve? |
I think you commented 2 secs before I updated the PR desciption :P This is the use case, X tiles inside the list should not open a page but just onTap:()=> doSomething() Bildschirmaufzeichnung.vom.2023-07-27.13-41-28.webm |
What if we'd allow diff --git a/lib/src/widgets/master_detail/yaru_master_tile.dart b/lib/src/widgets/master_detail/yaru_master_tile.dart
index f655985..5ba8a32 100644
--- a/lib/src/widgets/master_detail/yaru_master_tile.dart
+++ b/lib/src/widgets/master_detail/yaru_master_tile.dart
@@ -76,8 +76,11 @@ class YaruMasterTile extends StatelessWidget {
trailing: trailing,
selected: isSelected,
onTap: () {
- scope?.onTap();
- onTap?.call();
+ if (onTap != null) {
+ onTap!.call();
+ } else {
+ scope?.onTap();
+ }
},
),
), |
yeah that would be even better, that was funnily what I assumed would happen when you override ontap 😄 this would also fix #718 btw |
522a855
to
01799fd
Compare
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.
LGTM 👍
This adds a parameter to disable looking up the YaruMasterTileScope for tiles added to the list inside YMD that should not open a page.Is this the correct approach @jpnurmi ?Use case: 1 tile inside the list should open a dialog and not select/load a page
Closes #718