loggedIn function
Implementation
Future<BeautifulSoup?> loggedIn(String url, {Map<String, String>? data}) async {
Response<String> response;
if (data != null) {
response = await request(url,
data: data,
options: Options(
method: 'POST',
contentType: "application/x-www-form-urlencoded",
));
} else {
response = await request(url);
}
if (response.data is String) {
BeautifulSoup soup = BeautifulSoup(response.data as String);
if (response.realUri.toString().contains("login.aspx?prevurl")) {
return null;
} else {
return soup;
}
}
return null;
}