From 1bc24b4dbd046d3e7517ab7910fe0681e367b55c Mon Sep 17 00:00:00 2001 From: leoafarias Date: Wed, 16 Jun 2021 12:35:32 -0400 Subject: [PATCH] Fix issue when platform and theme brightness does not match --- lib/src/theme.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/theme.dart b/lib/src/theme.dart index 24525554..835330f3 100644 --- a/lib/src/theme.dart +++ b/lib/src/theme.dart @@ -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;