File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
packages/supabase/lib/src Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 11import 'package:supabase/src/version.dart' ;
22import 'dart:io' show Platform;
33
4+ const bool kIsWeb = bool .fromEnvironment ('dart.library.js_util' );
5+
46class Constants {
5- static String get platform {
6- return Platform .operatingSystem;
7+ static String ? get platform {
8+ return kIsWeb ? null : Platform .operatingSystem;
79 }
810
9- static String get platformVersion {
10- return Platform .operatingSystemVersion;
11+ static String ? get platformVersion {
12+ return kIsWeb ? null : Platform .operatingSystemVersion;
1113 }
1214
1315 static final Map <String , String > defaultHeaders = {
1416 '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! ,
1720 };
1821}
You can’t perform that action at this time.
0 commit comments