Skip to content

Commit

Permalink
Fix issue when platform and theme brightness does not match
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed Jun 16, 2021
1 parent cc23b35 commit 1bc24b4
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 1bc24b4

Please sign in to comment.