@@ -130,6 +130,23 @@ RoundedRectangleBorder get _roundedShape {
130
130
);
131
131
}
132
132
133
+ bool isNumeric (String s) {
134
+ if (s == null ) {
135
+ return false ;
136
+ }
137
+ return double .tryParse (s) != null ;
138
+ }
139
+
140
+ double getWindowsBuild () {
141
+ final osVer =
142
+ Platform .operatingSystemVersion.replaceAll (RegExp (r'[^\w\s\.]+' ), '' );
143
+
144
+ final splitOsVer = osVer.split (' ' );
145
+
146
+ final nums = splitOsVer.where ((element) => isNumeric (element)).toList ();
147
+ return double .parse (nums.last);
148
+ }
149
+
133
150
Color platformBackgroundColor (BuildContext context) {
134
151
final themeBrightness = Theme .of (context).brightness;
135
152
final platformBrightness = MediaQuery .of (context).platformBrightness;
@@ -140,13 +157,15 @@ Color platformBackgroundColor(BuildContext context) {
140
157
if (Platform .isMacOS) {
141
158
return Colors .transparent;
142
159
} else if (Platform .isWindows) {
143
- if (Platform .operatingSystemVersion.contains ('11' )) {
160
+ if (getWindowsBuild () >= 22449 ) {
161
+ print ("Windows 11" );
144
162
Window .setEffect (
145
163
effect: WindowEffect .mica,
146
- color: Theme . of (context).cardColor. withAlpha ( 140 ) ,
164
+ color: Colors .transparent ,
147
165
);
148
166
return Colors .transparent;
149
- } else if (Platform .operatingSystemVersion.contains ('10' )) {
167
+ } else if (getWindowsBuild () >= 10240 ) {
168
+ print ("Windows 10" );
150
169
Window .setEffect (
151
170
effect: WindowEffect .aero,
152
171
color: Theme .of (context).cardColor.withAlpha (220 ),
0 commit comments