mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add pagination to the devices list screen
Mirror the notifications list paging pattern (offset/limit, fetch one extra row to detect the next page, First/Prev/Next controls) across the devices DB query, REST endpoint, API client and UI. Also add a First page button to the notifications pagination row. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
75f597bfe4
commit
251c06277e
@@ -99,6 +99,8 @@ class BackendAPI {
|
||||
bool? isRegistered,
|
||||
String? owner,
|
||||
DeviceType? deviceType,
|
||||
int? offset,
|
||||
int? limit,
|
||||
}) async {
|
||||
debugPrint('About to call /devices');
|
||||
|
||||
@@ -110,6 +112,10 @@ class BackendAPI {
|
||||
? ''
|
||||
: deviceType.apiName;
|
||||
}
|
||||
if (offset != null) {
|
||||
params['page_offset'] = offset;
|
||||
params['page_limit'] = limit ?? _pageSize;
|
||||
}
|
||||
|
||||
final response = await _dio.get('/devices', queryParameters: params);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user