Skip to content

Commit 19e428d

Browse files
committed
Remove generic limitation and add hasItems indication getter
1 parent 93a5348 commit 19e428d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/api/paginated_result.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:stelaris/api/model/data_model.dart';
88
///
99
/// Type parameter [T] represents the specific [DataModel] implementation
1010
/// contained in this paginated result.
11-
class PaginatedResult<T extends DataModel> {
11+
class PaginatedResult<T> {
1212
/// The list of items for the current page.
1313
final List<T> items;
1414

@@ -40,6 +40,8 @@ class PaginatedResult<T extends DataModel> {
4040
required this.pageSize,
4141
});
4242

43+
bool get hasItems => items.isNotEmpty;
44+
4345
/// Whether there are more pages available after the current page.
4446
bool get hasNextPage => currentPage < totalPages;
4547

0 commit comments

Comments
 (0)