Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/widgets/drink_filter_sheets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ class SortOptionsSheet extends StatelessWidget {
child: ListTile(
leading: Radio<DrinkSort>(value: sort),
title: Text(sortLabel),
// Matches the CheckboxListTile rows in the category,
// style, and visibility sheets, which are all dense.
dense: true,
onTap: () {
provider.setSort(sort);
Navigator.pop(context);
Expand Down
41 changes: 41 additions & 0 deletions test/widgets/drink_filter_sheets_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,47 @@ void main() {
expect(find.text('ABV (High to Low)'), findsOneWidget);
});

testWidgets(
'SortOptionsSheet option rows are the same height as the other '
'sheets (regression: #507)',
(tester) async {
await tester.pumpWidget(
directHost(SortOptionsSheet(provider: provider)),
);
await tester.pumpAndSettle();

final sortTiles = tester
.widgetList<ListTile>(find.byType(ListTile))
.toList();
expect(sortTiles, isNotEmpty);
for (final tile in sortTiles) {
expect(
tile.dense,
isTrue,
reason:
'Sort options must be dense to match the category, style, '
'and visibility sheets.',
);
}

// The user-visible symptom was row pitch, not the flag: measure the
// rendered height and compare it against a sheet that was always
// dense, so this stays honest if Material changes its metrics.
final sortRowHeight = tester
.getSize(find.widgetWithText(ListTile, 'Name (A-Z)'))
.height;

await tester.pumpWidget(directHost(const CategoryFilterSheet()));
await tester.pumpAndSettle();

final categoryRowHeight = tester
.getSize(find.widgetWithText(CheckboxListTile, 'Beer (2)'))
.height;

expect(sortRowHeight, categoryRowHeight);
},
);

testWidgets('StyleFilterSheet shows styles in case-insensitive order', (
tester,
) async {
Expand Down
Loading