setUserAttributes static method

Future<BaseResponse> setUserAttributes(
  1. Map<String, Object> userAttributes
)

allows user to add a set of dynamic User Specific Attributes.

  • Parameters:
    • userAttribute: any set of information that the user needs to add for example (userName, userEmail etc ...)

Implementation

static Future<BaseResponse> setUserAttributes(
    Map<String, Object> userAttributes) async {
  List<Object?>? response = await _channel
      .invokeMethod('setUserAttributes', {"userAttributes": userAttributes});

  BaseResponse result = new BaseResponse(false, null);
  if (response != null) {
    if (response[0] != null) {
      result = new BaseResponse(response[0].toString() == "true", null);
    }
    if (response[1] != null) {
      GenericError error =
          GenericError.fromJson(json.decode(response[1]!.toString()));
      result = new BaseResponse(false, error);
    }
    return result;
  }
  return result;
}