Skip to content

Commit

Permalink
chore: 3.10.2+16
Browse files Browse the repository at this point in the history
fix: dark theme for non transparent themes
  • Loading branch information
Arenukvern committed Nov 18, 2021
1 parent 70b98e5 commit 49ab4a3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/utils/is_desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 3 additions & 1 deletion lib/utils/theme_definder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -34,5 +34,7 @@ class ThemeDefiner {
}
}

bool get useDarkTheme => themeToUse == ThemeToUse.nativeDark;

bool get useContextTheme => themeToUse == ThemeToUse.fromContext;
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 49ab4a3

Please sign in to comment.