lookupURLByQSP method

String? lookupURLByQSP(
  1. Map<String, String?> qsp, {
  2. bool useCacheBuster = true,
})

Look up URL by QSP.

Implementation

String? lookupURLByQSP(Map<String, String?> qsp,
    {bool useCacheBuster = true}) {
  if (qsp.isEmpty) {
    return null;
  }

  final parameters = <String>[];
  qsp.forEach((key, value) => parameters.add('$key=$value'));
  if (useCacheBuster) {
    parameters.add('_cb=${DateTime.now().microsecondsSinceEpoch.toString()}');
  }
  final finalParameters = parameters.join('&');

  return '$lookupPrefixURL?$finalParameters';
}