resolveUrl static method

String resolveUrl(
  1. String input,
  2. String baseUrl
)

Implementation

static String resolveUrl(String input, String baseUrl) {
  var resolvedLink = input;
  try {
    final isIgnored = URL_IGNORED_PATTERNS.map((p) => RegExp(p).hasMatch(input)).where((x) => x).isNotEmpty;

    if (!isIgnored) {
      final uri = Uri.parse(baseUrl);
      resolvedLink = uri.resolve(input).toString();
    }
  } catch (_) {}
  return resolvedLink;
}