secure method

String secure(
  1. String path, {
  2. Map<String, dynamic>? query,
})

Generate a secure URL (HTTPS) to the given path.

Implementation

String secure(String path, {Map<String, dynamic>? query}) {
  var secureUrl = url(path, query: query);
  if (secureUrl.startsWith('http://')) {
    secureUrl = secureUrl.replaceFirst('http://', 'https://');
  }
  return secureUrl;
}