track method

  1. @override
Future<void> track(
  1. HackleEvent event, {
  2. HackleUser? user,
})
override

Implementation

@override
Future<void> track(
  HackleEvent event, {
  HackleUser? user,
}) async {
  try {
    final Map<String, Object?> arguments = {
      Argument.event.value: event.toMap(),
      Argument.user.value: user?.toMap(),
    };

    return methodChannel.invokeMethod(Method.track.value, arguments);
  } catch (e) {
    log("Failed to track", level: 3, error: e);
  }
}