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,
|
categories[index].title,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: SuperListView(
|
body: Consumer(
|
||||||
|
builder: (context, ref, _) => ref
|
||||||
|
.watch(
|
||||||
|
SettingsController.provider,
|
||||||
|
)
|
||||||
|
.betterWhen(
|
||||||
|
data: (settings) => SuperListView(
|
||||||
padding: .symmetric(
|
padding: .symmetric(
|
||||||
vertical: 12,
|
vertical: 12,
|
||||||
horizontal: 8,
|
horizontal: 8,
|
||||||
),
|
),
|
||||||
children: buildCategories(settings)
|
children: buildCategories(settings)
|
||||||
.values
|
.values
|
||||||
.flattenedToList[selected.value]
|
.flattenedToList[selected
|
||||||
|
.value]
|
||||||
.settings
|
.settings
|
||||||
.map(
|
.map(
|
||||||
(setting) => Padding(
|
(setting) => Padding(
|
||||||
padding: .only(bottom: 4),
|
padding: .only(
|
||||||
|
bottom: 4,
|
||||||
|
),
|
||||||
child: setting.builder(
|
child: setting.builder(
|
||||||
setting.title,
|
setting.title,
|
||||||
setting.description,
|
setting
|
||||||
|
.description,
|
||||||
setting.icon,
|
setting.icon,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -210,6 +220,8 @@ class SettingsPage extends ConsumerWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
itemBuilder: (context, index) => ListTile(
|
itemBuilder: (context, index) => ListTile(
|
||||||
leading: Icon(categories[index].icon),
|
leading: Icon(categories[index].icon),
|
||||||
title: Text(categories[index].title),
|
title: Text(categories[index].title),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue