logEvent method

Future logEvent({
  1. required String? type,
  2. String? action,
  3. Map<String, String>? extras,
})

Implementation

Future logEvent(
    {required String? type,
    String? action,
    Map<String, String>? extras}) async {
  var data = {
    "action": action,
    "type": type,
    'extras': extras,
  };
  try {
    await _channel.invokeMethod(_logEventWith,data).then((result) {
      logger.d('logEvent $result');
    });
    return 'Success';
  } on PlatformException catch (e) {
    logger.d(e);
    return e;
  }
}