Fix searchbar appearing once per category on thin screens

This commit is contained in:
Henry Hiles 2026-06-26 16:21:45 -04:00
commit 1a2f40d144
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -72,48 +72,50 @@ class SettingsPage extends ConsumerWidget {
), ),
body: categoriesArePages body: categoriesArePages
? CustomScrollView( ? CustomScrollView(
slivers: settingsCategoryGroups slivers: [
.mapTo( SliverToBoxAdapter(
(categoryGroup, categories) => [ child: Padding(
SliverToBoxAdapter( padding: EdgeInsets.all(12).copyWith(bottom: 4),
child: Padding( child: searchBar,
padding: EdgeInsets.all(12).copyWith(bottom: 4), ),
child: searchBar, ),
), ...settingsCategoryGroups
), .mapTo(
SliverToBoxAdapter( (categoryGroup, categories) => [
child: Padding( SliverToBoxAdapter(
padding: EdgeInsets.symmetric( child: Padding(
horizontal: 16, padding: EdgeInsets.symmetric(
).copyWith(bottom: 4), horizontal: 16,
child: DividerText(categoryGroup), ).copyWith(bottom: 4),
), child: DividerText(categoryGroup),
),
SliverM3ECardList(
padding: .symmetric(horizontal: 4, vertical: 8),
margin: .symmetric(horizontal: 12),
color: Theme.of(
context,
).colorScheme.primaryContainer,
itemCount: categories.length,
onTap: (index) => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => Scaffold(
appBar: AppBar(
title: Text(categories[index].title),
),
body: ListView(),
),
), ),
), ),
itemBuilder: (context, index) => ListTile( SliverM3ECardList(
leading: Icon(categories[index].icon), padding: .symmetric(horizontal: 4, vertical: 8),
title: Text(categories[index].title), margin: .symmetric(horizontal: 12),
color: Theme.of(
context,
).colorScheme.primaryContainer,
itemCount: categories.length,
onTap: (index) => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => Scaffold(
appBar: AppBar(
title: Text(categories[index].title),
),
body: ListView(),
),
),
),
itemBuilder: (context, index) => ListTile(
leading: Icon(categories[index].icon),
title: Text(categories[index].title),
),
), ),
), ],
], )
) .flattened,
.flattenedToList, ],
) )
: Row( : Row(
children: [ children: [