track method

  1. @override
Future<bool> track({
  1. required String matchingKey,
  2. required String? bucketingKey,
  3. required String eventType,
  4. String? trafficType,
  5. double? value,
  6. Map<String, dynamic> properties = const {},
})

Implementation

@override
Future<bool> track(
    {required String matchingKey,
    required String? bucketingKey,
    required String eventType,
    String? trafficType,
    double? value,
    Map<String, dynamic> properties = const {}}) async {
  var parameters =
      _buildParameters(matchingKey, bucketingKey, {'eventType': eventType});

  if (trafficType != null) {
    parameters['trafficType'] = trafficType;
  }

  if (value != null) {
    parameters['value'] = value;
  }

  try {
    return await methodChannel.invokeMethod('track', parameters) as bool;
  } on Exception catch (_) {
    return false;
  }
}