Skip to content

Commit

Permalink
feat(YaruMasterTile): add lookUpScope parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier committed Jul 27, 2023
1 parent 0cc96d8 commit 522a855
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/src/widgets/master_detail/yaru_master_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class YaruMasterTile extends StatelessWidget {
this.subtitle,
this.trailing,
this.onTap,
this.lookUpScope = true,
});

/// See [ListTile.selected].
Expand All @@ -38,10 +39,17 @@ class YaruMasterTile extends StatelessWidget {
/// See [ListTile.onTap].
final VoidCallback? onTap;

/// Defines if this tile should lookup a [YaruMasterTileScope]
/// defaults to `true`
final bool lookUpScope;

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final scope = YaruMasterTileScope.maybeOf(context);
YaruMasterTileScope? scope;
if (lookUpScope) {
scope = YaruMasterTileScope.maybeOf(context);
}
final isSelected = selected ?? scope?.selected ?? false;
final scrollbarThicknessWithTrack =
_calcScrollbarThicknessWithTrack(context);
Expand Down

0 comments on commit 522a855

Please sign in to comment.