Add settings page #46
1 changed files with 30 additions and 18 deletions
fix reactivity of settings on mobile
commit
facb354b56
|
|
@ -186,21 +186,31 @@ class SettingsPage extends ConsumerWidget {
|
|||
categories[index].title,
|
||||
),
|
||||
),
|
||||
body: SuperListView(
|
||||
body: Consumer(
|
||||
builder: (context, ref, _) => ref
|
||||
.watch(
|
||||
SettingsController.provider,
|
||||
)
|
||||
.betterWhen(
|
||||
data: (settings) => SuperListView(
|
||||
padding: .symmetric(
|
||||
vertical: 12,
|
||||
horizontal: 8,
|
||||
),
|
||||
children: buildCategories(settings)
|
||||
.values
|
||||
.flattenedToList[selected.value]
|
||||
.flattenedToList[selected
|
||||
.value]
|
||||
.settings
|
||||
.map(
|
||||
(setting) => Padding(
|
||||
padding: .only(bottom: 4),
|
||||
padding: .only(
|
||||
bottom: 4,
|
||||
),
|
||||
child: setting.builder(
|
||||
setting.title,
|
||||
setting.description,
|
||||
setting
|
||||
.description,
|
||||
setting.icon,
|
||||
),
|
||||
),
|
||||
|
|
@ -210,6 +220,8 @@ class SettingsPage extends ConsumerWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
itemBuilder: (context, index) => ListTile(
|
||||
leading: Icon(categories[index].icon),
|
||||
title: Text(categories[index].title),
|
||||
|
|
|
|||
Loading…
Reference in a new issue