File tree 1 file changed +9
-6
lines changed
packages/supabase/lib/src
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:supabase/src/version.dart' ;
2
2
import 'dart:io' show Platform;
3
3
4
+ const bool kIsWeb = bool .fromEnvironment ('dart.library.js_util' );
5
+
4
6
class Constants {
5
- static String get platform {
6
- return Platform .operatingSystem;
7
+ static String ? get platform {
8
+ return kIsWeb ? null : Platform .operatingSystem;
7
9
}
8
10
9
- static String get platformVersion {
10
- return Platform .operatingSystemVersion;
11
+ static String ? get platformVersion {
12
+ return kIsWeb ? null : Platform .operatingSystemVersion;
11
13
}
12
14
13
15
static final Map <String , String > defaultHeaders = {
14
16
'X-Client-Info' : 'supabase-dart/$version ' ,
15
- 'X-Supabase-Client-Platform' : platform,
16
- 'X-Supabase-Client-Platform-Version' : platformVersion,
17
+ if (platform != null ) 'X-Supabase-Client-Platform' : platform! ,
18
+ if (platformVersion != null )
19
+ 'X-Supabase-Client-Platform-Version' : platformVersion! ,
17
20
};
18
21
}
You can’t perform that action at this time.
0 commit comments