recordInteraction method

Future<void> recordInteraction(
  1. String widgetId,
  2. String userId, {
  3. String action = 'tap',
})

Record a widget interaction.

Implementation

Future<void> recordInteraction(
  String widgetId,
  String userId, {
  String action = 'tap',
}) async {
  final uri = Uri.parse('$baseUrl/api/widgets/$widgetId/interact');
  final response = await _client.post(
    uri,
    headers: _postHeaders,
    body: json.encode({'user_id': userId, 'action': action}),
  );
  _checkResponse(response);
}