From 23e3452cf1930a7e6760f9950b21ff4a9dc8d7b7 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Fri, 6 Jan 2023 09:12:01 -0700 Subject: [PATCH] oledBlack theme added to desktop --- lib/main.dart | 5 +- .../settings_menu/appearance_settings.dart | 186 +++++++++--------- lib/utilities/assets.dart | 1 + lib/utilities/theme/oled_black_colors.dart | 2 +- lib/widgets/background.dart | 1 + 5 files changed, 102 insertions(+), 93 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 4303889b7..ce9053e2c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -59,6 +59,7 @@ import 'package:stackwallet/utilities/theme/color_theme.dart'; import 'package:stackwallet/utilities/theme/dark_colors.dart'; import 'package:stackwallet/utilities/theme/light_colors.dart'; import 'package:stackwallet/utilities/theme/ocean_breeze_colors.dart'; +import 'package:stackwallet/utilities/theme/oled_black_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:window_size/window_size.dart'; @@ -75,7 +76,6 @@ void main() async { if (Platform.isIOS) { Util.libraryPath = await getLibraryDirectory(); } - Screen? screen; if (Platform.isLinux || (Util.isDesktop && !Platform.isIOS)) { screen = await getCurrentScreen(); @@ -323,6 +323,9 @@ class _MaterialAppWithThemeState extends ConsumerState case "dark": colorTheme = DarkColors(); break; + case "oledBlack": + colorTheme = OledBlackColors(); + break; case "oceanBreeze": colorTheme = OceanBreezeColors(); break; diff --git a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart index d1812c89f..dcbbd15b1 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart @@ -35,106 +35,110 @@ class _AppearanceOptionSettings ), child: RoundedWhiteContainer( radiusMultiplier: 2, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: Wrap( children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: SvgPicture.asset( - Assets.svg.circleSun, - width: 48, - height: 48, - ), - ), Column( - crossAxisAlignment: CrossAxisAlignment.stretch, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: const EdgeInsets.all(10), - child: RichText( - textAlign: TextAlign.left, - text: TextSpan( - children: [ - TextSpan( - text: "Appearances", - style: STextStyles.desktopTextSmall(context), - ), - TextSpan( - text: - "\n\nCustomize how your Stack Wallet looks according to your preferences.", - style: STextStyles.desktopTextExtraExtraSmall( - context), - ), - ], - ), + padding: const EdgeInsets.all(8.0), + child: SvgPicture.asset( + Assets.svg.circleSun, + width: 48, + height: 48, ), ), - ], - ), - const Padding( - padding: EdgeInsets.all(10.0), - child: Divider( - thickness: 0.5, - ), - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Display favorite wallets", - style: STextStyles.desktopTextExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textDark), - textAlign: TextAlign.left, - ), - SizedBox( - height: 20, - width: 40, - child: DraggableSwitchButton( - isOn: ref.watch( - prefsChangeNotifierProvider - .select((value) => value.showFavoriteWallets), + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Padding( + padding: const EdgeInsets.all(10), + child: RichText( + textAlign: TextAlign.left, + text: TextSpan( + children: [ + TextSpan( + text: "Appearances", + style: STextStyles.desktopTextSmall(context), + ), + TextSpan( + text: + "\n\nCustomize how your Stack Wallet looks according to your preferences.", + style: STextStyles.desktopTextExtraExtraSmall( + context), + ), + ], + ), ), - onValueChanged: (newValue) { - ref - .read(prefsChangeNotifierProvider) - .showFavoriteWallets = newValue; - }, ), - ) - ], - ), - ), - const Padding( - padding: EdgeInsets.all(10.0), - child: Divider( - thickness: 0.5, - ), - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Choose theme", - style: STextStyles.desktopTextExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textDark), - textAlign: TextAlign.left, + ], + ), + const Padding( + padding: EdgeInsets.all(10.0), + child: Divider( + thickness: 0.5, ), - ], - ), - ), - const Padding( - padding: EdgeInsets.all(10), - child: ThemeToggle(), + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Display favorite wallets", + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textDark), + textAlign: TextAlign.left, + ), + SizedBox( + height: 20, + width: 40, + child: DraggableSwitchButton( + isOn: ref.watch( + prefsChangeNotifierProvider.select( + (value) => value.showFavoriteWallets), + ), + onValueChanged: (newValue) { + ref + .read(prefsChangeNotifierProvider) + .showFavoriteWallets = newValue; + }, + ), + ) + ], + ), + ), + const Padding( + padding: EdgeInsets.all(10.0), + child: Divider( + thickness: 0.5, + ), + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Choose theme", + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textDark), + textAlign: TextAlign.left, + ), + ], + ), + ), + Padding( + padding: EdgeInsets.all(10), + child: ThemeToggle(), + ), + ], ), ], ), diff --git a/lib/utilities/assets.dart b/lib/utilities/assets.dart index 6c421ebec..f9128205d 100644 --- a/lib/utilities/assets.dart +++ b/lib/utilities/assets.dart @@ -33,6 +33,7 @@ class _SVG { switch (Theme.of(context).extension()!.themeType) { case ThemeType.light: case ThemeType.dark: + case ThemeType.oledBlack: return null; case ThemeType.oceanBreeze: diff --git a/lib/utilities/theme/oled_black_colors.dart b/lib/utilities/theme/oled_black_colors.dart index 1a3fd0cc4..102dc96f5 100644 --- a/lib/utilities/theme/oled_black_colors.dart +++ b/lib/utilities/theme/oled_black_colors.dart @@ -3,7 +3,7 @@ import 'package:stackwallet/utilities/theme/color_theme.dart'; class OledBlackColors extends StackColorTheme { @override - ThemeType get themeType => ThemeType.dark; + ThemeType get themeType => ThemeType.oledBlack; @override Color get background => const Color(0xFF000000); diff --git a/lib/widgets/background.dart b/lib/widgets/background.dart index 67ff44f55..0a14e2df6 100644 --- a/lib/widgets/background.dart +++ b/lib/widgets/background.dart @@ -20,6 +20,7 @@ class Background extends StatelessWidget { switch (Theme.of(context).extension()!.themeType) { case ThemeType.light: case ThemeType.dark: + case ThemeType.oledBlack: color = Theme.of(context).extension()!.background; break; case ThemeType.oceanBreeze: