Skip to content

Commit

Permalink
fix: overflow in left pane of YaruMasterDetailPage (#787)
Browse files Browse the repository at this point in the history
Fixes #785
  • Loading branch information
Jupi007 authored Oct 19, 2023
1 parent 4e1cb14 commit 9da3275
Showing 1 changed file with 19 additions and 33 deletions.
52 changes: 19 additions & 33 deletions lib/src/widgets/master_detail/yaru_master_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,31 @@ class YaruMasterListView extends StatefulWidget {
}

class _YaruMasterListViewState extends State<YaruMasterListView> {
final _controller = ScrollController();

@override
void dispose() {
_controller.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
final theme = YaruMasterDetailTheme.of(context);
return CustomScrollView(
controller: _controller,
slivers: [
SliverFillRemaining(
hasScrollBody: false,
child: Padding(
padding: theme.listPadding ?? EdgeInsets.zero,
child: Column(
children: List.generate(
widget.length,
(index) => YaruMasterTileScope(
index: index,
selected: index == widget.selectedIndex,
onTap: () => widget.onTap(index),
child: Builder(
builder: (context) => widget.builder(
context,
index,
index == widget.selectedIndex,
widget.availableWidth,
),
),
return SingleChildScrollView(
child: Padding(
padding: theme.listPadding ?? EdgeInsets.zero,
child: Column(
children: List.generate(
widget.length,
(index) => YaruMasterTileScope(
index: index,
selected: index == widget.selectedIndex,
onTap: () => widget.onTap(index),
child: Builder(
builder: (context) => widget.builder(
context,
index,
index == widget.selectedIndex,
widget.availableWidth,
),
).withSpacing(theme.tileSpacing ?? 0),
),
),
),
).withSpacing(theme.tileSpacing ?? 0),
),
],
),
);
}
}
Expand Down

0 comments on commit 9da3275

Please sign in to comment.