getUserInfo static method

Future<B2CUserInfo?> getUserInfo(
  1. String subject
)

Returns subject's stored information.

Returns a Future containing a B2CUserInfo object or null if the subject does not exists.

See also:

  • B2CUserInfo

Implementation

static Future<B2CUserInfo?> getUserInfo(String subject) async {
  print("[AzureB2C] [getUserInfo] invoked...");

  var args = {"subject": subject};
  var rawRes = await _channel.invokeMethod('getSubjectInfo', args);

  if (rawRes != null) {
    final Map<String, dynamic>? res = json.decode(rawRes);
    print("[AzureB2C] [getUserInfo] data: $res");
    return B2CUserInfo.fromJson(subject, res!);
  } else
    return null;
}