setCustomAttributes method

Future<void> setCustomAttributes(
  1. Map<String, dynamic> attributes
)

Implementation

Future<void> setCustomAttributes(Map<String, dynamic> attributes) async {
  try {
    String attributesJson = jsonEncode(attributes);
    var jsCode = '''
      window.\$ruut.setCustomAttributes($attributesJson);
    ''';
    await _controller.runJavaScript(jsCode);
  } catch (e) {
    // print('Error setting custom attributes: $e');
  }
}