isUrlNeedToOveride method

Uri isUrlNeedToOveride(
  1. Uri? globalUrl,
  2. Uri url
)

Implementation

Uri isUrlNeedToOveride(Uri? globalUrl, Uri url) {
  if (globalUrl != null) {
    bool isEligible = url.isAbsolute;
    bool isHaveBaseSection = url.hasAuthority;
    bool isHaveHost = url.host.isNotEmpty;
    bool isOverride = (isEligible && isHaveBaseSection && isHaveHost);

    var result = (isOverride) ? url : compilePathToUri(url, globalUrl);
    return result;
  } else {
    return url;
  }
}