fix wrong settings categories opening when multiple sections exist
This commit is contained in:
parent
87e1ef0d9b
commit
80b938c0be
1 changed files with 10 additions and 3 deletions
|
|
@ -127,13 +127,13 @@ class SettingsPage extends ConsumerWidget {
|
||||||
),
|
),
|
||||||
...sections
|
...sections
|
||||||
.mapTo(
|
.mapTo(
|
||||||
(categoryGroup, categories) => [
|
(section, categories) => [
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
horizontal: 16,
|
horizontal: 16,
|
||||||
).copyWith(bottom: 4),
|
).copyWith(bottom: 4),
|
||||||
child: DividerText(categoryGroup),
|
child: DividerText(section),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SliverM3ECardList(
|
SliverM3ECardList(
|
||||||
|
|
@ -150,7 +150,14 @@ class SettingsPage extends ConsumerWidget {
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
SettingsCategoryPage(index),
|
SettingsCategoryPage(
|
||||||
|
sections
|
||||||
|
.values
|
||||||
|
.flattenedToList
|
||||||
|
.indexOf(
|
||||||
|
categories[index],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
itemBuilder: (context, index) => ListTile(
|
itemBuilder: (context, index) => ListTile(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue