handleTrackSchema method

void handleTrackSchema({
  1. required String eventName,
  2. required List<Map<String, dynamic>> eventSchema,
  3. String? eventId,
  4. String? eventHash,
})

Implementation

void handleTrackSchema(
    {required String eventName,
    required List<Map<String, dynamic>> eventSchema,
    String? eventId,
    String? eventHash}) {
  _startOrProlongSession(DateTime.now().millisecondsSinceEpoch);

  _events.add(networkCallsHandler.bodyForEventSchemaCall(
      eventName: eventName,
      eventSchema: eventSchema,
      sessionId: sessionTracker.sessionId,
      installationId: avoInstallationId));

  _saveEvents();

  if (AvoInspector.shouldLog) {
    print("Avo Inspector: saved event " +
        eventName +
        " with schema " +
        jsonEncode(eventSchema));
  }

  _checkIfBatchNeedsToBeSent();
}