getGlobalProperties method

  1. @override
Future<Map<String, String>?> getGlobalProperties()
override

Retrieves global properties.

Implementation

@override
Future<Map<String, String>?> getGlobalProperties() async {
  Map<String, String> globalProperties = <String, String>{};
  Map<Object?, Object?>? globalSDKProperties = await methodChannel
      .invokeMethod<Map<Object?, Object?>>('getGlobalProperties');
  globalProperties.putIfAbsent(
    PerceptSDK.version.asString,
    () => getPluginVersion(),
  );
  globalProperties.putIfAbsent(PerceptSDK.type.asString, () => "Flutter");
  globalSDKProperties?.forEach(
      (k, v) => globalProperties.putIfAbsent(k as String, () => v as String));
  return globalProperties;
}