getAllProfileProperties static method

Future<Map<String, List<String>>> getAllProfileProperties()

Retrieves all profile properties and their values asynchronously.

This method returns a map containing all profile properties as keys and their corresponding values as lists of strings.

Returns a Future<Map<String, List<String>>> containing all profile properties

Implementation

static Future<Map<String, List<String>>> getAllProfileProperties() {
  final Completer<Map<String, List<String>>> completer =
      Completer<Map<String, List<String>>>();
  BlueConicPlatform.instance.getAllProfileProperties().then((result) {
    if (result.success) {
      try {
        final Map<String, List<String>> converted = (result.data as Map).map(
          (key, value) => MapEntry(key.toString(), List<String>.from(value)),
        );
        completer.complete(converted);
      } catch (e) {
        completer.completeError(
          Exception(
            'Failed to convert result to Map<String, List<String>>: $e',
          ),
        );
      }
    } else {
      completer.completeError(Exception(result.error ?? 'Unknown error'));
    }
  });
  return completer.future;
}