getProfileValue static method

Future<String> getProfileValue(
  1. String property
)

Gets the value of a specified profile property asynchronously.

Profile properties store information about the user in BlueConic.

property The name of the profile property to retrieve Returns a Future<String> containing the property value

Implementation

static Future<String> getProfileValue(String property) {
  final Completer<String> completer = Completer<String>();
  BlueConicPlatform.instance.getProfileValue(property).then((result) {
    if (result.success) {
      completer.complete((result.data as String?) ?? '');
    } else {
      completer.completeError(Exception(result.error ?? 'Unknown error'));
    }
  });
  return completer.future;
}