diff --git a/asset_sources/default_themes/stack_wallet/dark.zip b/asset_sources/default_themes/stack_wallet/dark.zip index df24199c4..a85917505 100644 Binary files a/asset_sources/default_themes/stack_wallet/dark.zip and b/asset_sources/default_themes/stack_wallet/dark.zip differ diff --git a/asset_sources/default_themes/stack_wallet/light.zip b/asset_sources/default_themes/stack_wallet/light.zip index 9e0c82d9d..b26156da8 100644 Binary files a/asset_sources/default_themes/stack_wallet/light.zip and b/asset_sources/default_themes/stack_wallet/light.zip differ diff --git a/lib/themes/theme_service.dart b/lib/themes/theme_service.dart index 1915239a5..542c6375e 100644 --- a/lib/themes/theme_service.dart +++ b/lib/themes/theme_service.dart @@ -31,9 +31,7 @@ final pThemeService = Provider<ThemeService>((ref) { }); class ThemeService { - // dumb quick conditional based on name. Should really be done better - static const _currentDefaultThemeVersion = - AppConfig.appName == "Campfire" ? 17 : 16; + static const _currentDefaultThemeVersion = 17; ThemeService._(); static ThemeService? _instance; static ThemeService get instance => _instance ??= ThemeService._(); @@ -61,9 +59,7 @@ class ThemeService { final jsonString = utf8.decode(themeJsonFiles.first.content as List<int>); final json = jsonDecode(jsonString) as Map; - final theme = StackTheme.fromJson( - json: Map<String, dynamic>.from(json), - ); + final theme = StackTheme.fromJson(json: Map<String, dynamic>.from(json)); try { theme.assets; @@ -96,11 +92,12 @@ class ThemeService { Future<void> remove({required String themeId}) async { final themesDir = StackFileSystem.themesDir!; - final isarId = await db.isar.stackThemes - .where() - .themeIdEqualTo(themeId) - .idProperty() - .findFirst(); + final isarId = + await db.isar.stackThemes + .where() + .themeIdEqualTo(themeId) + .idProperty() + .findFirst(); if (isarId != null) { await db.isar.writeTxn(() async { await db.isar.stackThemes.delete(isarId); @@ -184,22 +181,27 @@ class ThemeService { try { final response = await client.get( url: Uri.parse("$baseServerUrl/themes"), - proxyInfo: Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: + Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final jsonList = jsonDecode(response.body) as List; - final result = List<Map<String, dynamic>>.from(jsonList) - .map((e) => StackThemeMetaData.fromMap(e)) - .where((e) => e.id != "light" && e.id != "dark") - .toList(); + final result = + List<Map<String, dynamic>>.from(jsonList) + .map((e) => StackThemeMetaData.fromMap(e)) + .where((e) => e.id != "light" && e.id != "dark") + .toList(); return result; } catch (e, s) { - Logging.instance - .w("Failed to fetch themes list: ", error: e, stackTrace: s); + Logging.instance.w( + "Failed to fetch themes list: ", + error: e, + stackTrace: s, + ); rethrow; } } @@ -210,9 +212,10 @@ class ThemeService { try { final response = await client.get( url: Uri.parse("$baseServerUrl/theme/${themeMetaData.id}"), - proxyInfo: Prefs.instance.useTor - ? TorService.sharedInstance.getProxyInfo() - : null, + proxyInfo: + Prefs.instance.useTor + ? TorService.sharedInstance.getProxyInfo() + : null, ); final bytes = Uint8List.fromList(response.bodyBytes); @@ -228,8 +231,11 @@ class ThemeService { ); } } catch (e, s) { - Logging.instance - .w("Failed to fetch themes list: ", error: e, stackTrace: s); + Logging.instance.w( + "Failed to fetch themes list: ", + error: e, + stackTrace: s, + ); rethrow; } } @@ -270,9 +276,10 @@ class StackThemeMetaData { ); } catch (e, s) { Logging.instance.f( - "Failed to create instance of StackThemeMetaData using $map", - error: e, - stackTrace: s); + "Failed to create instance of StackThemeMetaData using $map", + error: e, + stackTrace: s, + ); rethrow; } }