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 =
Map.from(uri.queryParametersAll).cast<String, dynamic>();
var pageEntry = findKeyEntry(queryParameters, ['-PAGE', '--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();
}