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:
rzuasti
2026-05-29 13:07:27 -04:00
co-authored by Claude Opus 4.7
parent 75f597bfe4
commit 251c06277e
6 changed files with 148 additions and 21 deletions
+6
View File
@@ -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);