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
|
||||
.map((e) => Tuple2(e.themeId, e.name))
|
||||
.toList();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_updateInstalledList();
|
||||
|
||||
if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) {
|
||||
_current = installedThemeIdNames.length;
|
||||
|
@ -110,6 +105,11 @@ class _ThemeOptionsWidgetState extends ConsumerState<ThemeOptionsWidget> {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_updateInstalledList();
|
||||
|
||||
_subscription =
|
||||
ref.read(mainDBProvider).isar.stackThemes.watchLazy().listen((_) {
|
||||
|
@ -212,6 +212,7 @@ class _ThemeOptionsWidgetState extends ConsumerState<ThemeOptionsWidget> {
|
|||
),
|
||||
for (int i = 0; i < installedThemeIdNames.length; i++)
|
||||
ConditionalParent(
|
||||
key: Key("installedTheme_${installedThemeIdNames[i].item1}"),
|
||||
condition: i > 0,
|
||||
builder: (child) => Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
|
|
|
@ -272,18 +272,6 @@ class _ThemeToggle extends ConsumerState<ThemeToggle> {
|
|||
.installedThemes
|
||||
.map((e) => Tuple3(e.themeId, e.name, e.assets.themeSelector))
|
||||
.toList();
|
||||
}
|
||||
|
||||
void _manageThemesPressed() {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => const DesktopManageThemesDialog(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_updateInstalledList();
|
||||
|
||||
if (ref.read(prefsChangeNotifierProvider).enableSystemBrightness) {
|
||||
_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 =
|
||||
ref.read(mainDBProvider).isar.stackThemes.watchLazy().listen((_) {
|
||||
|
@ -326,6 +326,7 @@ class _ThemeToggle extends ConsumerState<ThemeToggle> {
|
|||
children: [
|
||||
for (int i = 0; i < installedThemeIdNames.length; i++)
|
||||
Padding(
|
||||
key: Key("installedTheme_${installedThemeIdNames[i].item1}"),
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
|
|
Loading…
Reference in a new issue