mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
fix: selected theme on deleting themes changing
This commit is contained in:
parent
147914f650
commit
b715cf9535
2 changed files with 19 additions and 17 deletions
|
@ -92,11 +92,6 @@ class _ThemeOptionsWidgetState extends ConsumerState<ThemeOptionsWidget> {
|
||||||
.installedThemes
|
.installedThemes
|
||||||
.map((e) => Tuple2(e.themeId, e.name))
|
.map((e) => Tuple2(e.themeId, e.name))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
_updateInstalledList();
|
|
||||||
|
|
||||||
if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) {
|
if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) {
|
||||||
_current = installedThemeIdNames.length;
|
_current = installedThemeIdNames.length;
|
||||||
|
@ -110,6 +105,11 @@ class _ThemeOptionsWidgetState extends ConsumerState<ThemeOptionsWidget> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_updateInstalledList();
|
||||||
|
|
||||||
_subscription =
|
_subscription =
|
||||||
ref.read(mainDBProvider).isar.stackThemes.watchLazy().listen((_) {
|
ref.read(mainDBProvider).isar.stackThemes.watchLazy().listen((_) {
|
||||||
|
@ -212,6 +212,7 @@ class _ThemeOptionsWidgetState extends ConsumerState<ThemeOptionsWidget> {
|
||||||
),
|
),
|
||||||
for (int i = 0; i < installedThemeIdNames.length; i++)
|
for (int i = 0; i < installedThemeIdNames.length; i++)
|
||||||
ConditionalParent(
|
ConditionalParent(
|
||||||
|
key: Key("installedTheme_${installedThemeIdNames[i].item1}"),
|
||||||
condition: i > 0,
|
condition: i > 0,
|
||||||
builder: (child) => Padding(
|
builder: (child) => Padding(
|
||||||
padding: const EdgeInsets.only(top: 10),
|
padding: const EdgeInsets.only(top: 10),
|
||||||
|
|
|
@ -272,18 +272,6 @@ class _ThemeToggle extends ConsumerState<ThemeToggle> {
|
||||||
.installedThemes
|
.installedThemes
|
||||||
.map((e) => Tuple3(e.themeId, e.name, e.assets.themeSelector))
|
.map((e) => Tuple3(e.themeId, e.name, e.assets.themeSelector))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
|
||||||
|
|
||||||
void _manageThemesPressed() {
|
|
||||||
showDialog<void>(
|
|
||||||
context: context,
|
|
||||||
builder: (_) => const DesktopManageThemesDialog(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
_updateInstalledList();
|
|
||||||
|
|
||||||
if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) {
|
if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) {
|
||||||
_current = installedThemeIdNames.length;
|
_current = installedThemeIdNames.length;
|
||||||
|
@ -297,6 +285,18 @@ class _ThemeToggle extends ConsumerState<ThemeToggle> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _manageThemesPressed() {
|
||||||
|
showDialog<void>(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => const DesktopManageThemesDialog(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_updateInstalledList();
|
||||||
|
|
||||||
_subscription =
|
_subscription =
|
||||||
ref.read(mainDBProvider).isar.stackThemes.watchLazy().listen((_) {
|
ref.read(mainDBProvider).isar.stackThemes.watchLazy().listen((_) {
|
||||||
|
@ -326,6 +326,7 @@ class _ThemeToggle extends ConsumerState<ThemeToggle> {
|
||||||
children: [
|
children: [
|
||||||
for (int i = 0; i < installedThemeIdNames.length; i++)
|
for (int i = 0; i < installedThemeIdNames.length; i++)
|
||||||
Padding(
|
Padding(
|
||||||
|
key: Key("installedTheme_${installedThemeIdNames[i].item1}"),
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: MouseRegion(
|
child: MouseRegion(
|
||||||
cursor: SystemMouseCursors.click,
|
cursor: SystemMouseCursors.click,
|
||||||
|
|
Loading…
Reference in a new issue