getIssuer function
Get POD issuer URI
Implementation
Future<String> getIssuer(String textUrl) async {
String issuerUri = '';
if (textUrl.contains('profile/card#me')) {
String pubProf = await fetchProfileData(textUrl);
issuerUri = getIssuerUri(pubProf);
}
if (issuerUri == '') {
/// This reg expression works with localhost and other urls
RegExp exp = RegExp(r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+(\.|\:)[\w\.]+');
Iterable<RegExpMatch> matches = exp.allMatches(textUrl);
for (var match in matches) {
issuerUri = textUrl.substring(match.start, match.end);
}
}
return issuerUri;
}