From 49ab4a311fed20d68d974d45b0d6bcfba0934431 Mon Sep 17 00:00:00 2001 From: Anton Malofeev Date: Thu, 18 Nov 2021 16:27:46 +0300 Subject: [PATCH] chore: 3.10.2+16 fix: dark theme for non transparent themes --- lib/utils/is_desktop.dart | 3 ++- lib/utils/theme_definder.dart | 4 +++- pubspec.yaml | 2 +- snap/snapcraft.yaml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/utils/is_desktop.dart b/lib/utils/is_desktop.dart index f4ae7be7..b9ed086d 100644 --- a/lib/utils/is_desktop.dart +++ b/lib/utils/is_desktop.dart @@ -5,7 +5,8 @@ final isDesktop = defaultTargetPlatform == TargetPlatform.linux || defaultTargetPlatform == TargetPlatform.macOS || defaultTargetPlatform == TargetPlatform.windows; -final isNativeDesktop = Platform.isMacOS || Platform.isLinux; +final isNativeDesktop = (Platform.isMacOS || Platform.isLinux) && !kIsWeb; +final transparentBackgroundSupported = Platform.isMacOS; final isAppleDevice = defaultTargetPlatform == TargetPlatform.macOS || defaultTargetPlatform == TargetPlatform.iOS; diff --git a/lib/utils/theme_definder.dart b/lib/utils/theme_definder.dart index 218989f6..5196b4d2 100644 --- a/lib/utils/theme_definder.dart +++ b/lib/utils/theme_definder.dart @@ -21,7 +21,7 @@ class ThemeDefiner { } ThemeToUse get themeToUse { - if (isNativeDesktop) { + if (isNativeDesktop && transparentBackgroundSupported) { final platformBrightness = MediaQuery.of(context).platformBrightness; switch (platformBrightness) { case Brightness.dark: @@ -34,5 +34,7 @@ class ThemeDefiner { } } + bool get useDarkTheme => themeToUse == ThemeToUse.nativeDark; + bool get useContextTheme => themeToUse == ThemeToUse.fromContext; } diff --git a/pubspec.yaml b/pubspec.yaml index 9d97176a..10350bed 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 3.10.1+15 +version: 3.10.2+16 environment: sdk: ">=2.14.0 <3.0.0" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 951d477c..4ce8f01f 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: last-answer -version: 3.10.1+15 +version: 3.10.2+16 summary: Fast ideas brainstorming tool with quick notes description: | You have a cool idea.