WIP: Add settings page #46
1 changed files with 39 additions and 37 deletions
Fix searchbar appearing once per category on thin screens
commit
1a2f40d144
|
|
@ -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: [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue