Refactor tenders pagination and enhance API integration
- Updated TendersRepository and TendersService to support cursor-based pagination. - Modified TendersViewModel to manage pagination state and handle API responses more effectively. - Replaced existing pagination UI components with a new WindowedPagination widget across desktop, mobile, and tablet views. - Improved notification handling in the UI to reflect the presence of notifications dynamically. - Adjusted main tenders slider to ensure proper rendering based on the current page index.
This commit is contained in:
@@ -4,14 +4,20 @@ class TendersApi {
|
||||
static const String tenders = '/api/v1/tenders';
|
||||
static String getTenders({
|
||||
required int limit,
|
||||
required int offset,
|
||||
int? offset,
|
||||
String? cursor,
|
||||
String? query,
|
||||
String? sortBy,
|
||||
String? sortOrder,
|
||||
String? publicationDateFrom,
|
||||
String? publicationDateTo,
|
||||
}) {
|
||||
String url = '$tenders?limit=$limit&offset=$offset';
|
||||
String url = '$tenders?limit=$limit';
|
||||
if (cursor != null && cursor.isNotEmpty) {
|
||||
url += '&cursor=${Uri.encodeComponent(cursor)}';
|
||||
} else if (offset != null) {
|
||||
url += '&offset=$offset';
|
||||
}
|
||||
if (query != null && query.isNotEmpty) {
|
||||
url += '&q=${Uri.encodeComponent(query)}';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user