pagingRequestURL method
The url for a request using url
and page
to build.
Implementation
@override
String pagingRequestURL(String url, int page) {
var uri = Uri.parse(url);
var queryParameters = uri.queryParametersAll.cast<String, dynamic>();
var pageEntry = findKeyEntry(queryParameters, ['page']);
if (pageEntry != null) {
queryParameters[pageEntry.key] = '$page';
} else {
queryParameters['page'] = '$page';
}
return Uri(
scheme: uri.scheme,
userInfo: uri.userInfo,
host: uri.host,
port: uri.port,
path: uri.path,
queryParameters: queryParameters)
.toString();
}