endEvent static method

  1. @Deprecated('This function is deprecated, please use "endEvent" of events instead')
Future<String?> endEvent(
  1. Map<String, Object> options
)

ends a timed event returns error or success message

Implementation

@Deprecated('This function is deprecated, please use "endEvent" of events instead')
static Future<String?> endEvent(Map<String, Object> options) async {
  String? key = options['key'] as String?;
  Map<String, Object>? segmentation = options['segmentation'] as Map<String, Object>?;
  int? count = _parseValue(options, 'count', 1);
  double? sum = _parseValue(options, 'sum', 0);

  if (key == null) {
    String message = 'endEvent, key cannot be null';
    log(message);
    return message;
  }

  await _instance.events.endEvent(key, segmentation, count, sum);
  return 'endEvent called';
}