userExists function

Future<bool> userExists(
  1. String userName,
  2. String server,
  3. String baseUrl,
  4. String apiBase,
)

Checks whether the supplied user exists on the given instance. If they do exist, "true" is returned. If they don't exist, "false" is returned.

Implementation

Future<bool> userExists(
	String userName,
  String server,
  String baseUrl,
  String apiBase,
) async {
	Map<String,dynamic> userInfo = await getUserInfo(
		userName,
		server,
		baseUrl,
		apiBase
	);
	bool result = false;
	if (responseIsError(userInfo) == false){
		result = true;
	}
	else {
		// Do nothing.
	}
	return result;
}