String
url(- dynamic className,
- {dynamic objectId = '',
- dynamic queries = const {},
- dynamic definePath = ''}
)
Implementation
String url(className, {objectId = '', queries = const {}, definePath = ''}) {
List queryList = [];
queries.forEach((key, value) {
if (value is Map || value is List) {
value = jsonEncode(value);
}
if (value is int) {
value = value.toString();
}
queryList.add("$key=${Uri.encodeQueryComponent(value)}");
});
String queryString = queryList.length == 0 ? '' : "?${queryList.join('&')}";
return "https://$_fqdn${path(className, objectId: objectId, definePath: definePath)}$queryString";
}