Skip to content

Commit

Permalink
Merge pull request #94 from leoafarias/fix/platform-theme-brightness
Browse files Browse the repository at this point in the history
Fix issue when platform and theme brightness does not match
  • Loading branch information
leoafarias authored Jun 16, 2021
2 parents c6ba820 + 1bc24b4 commit e676323
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ RoundedRectangleBorder get _roundedShape {
}

Color platformBackgroundColor(BuildContext context) {
if (Platform.isMacOS && Theme.of(context).brightness == Brightness.dark) {
final themeBrightness = Theme.of(context).brightness;
final platformBrightness = MediaQuery.of(context).platformBrightness;
final brightnessMatches = themeBrightness == platformBrightness;
if (Platform.isMacOS && brightnessMatches) {
return Colors.transparent;
} else {
return Theme.of(context).cardColor;
Expand Down

0 comments on commit e676323

Please sign in to comment.