DbPage class

One page of query results plus the pagination metadata computed by QueryBuilder.paginate.

Plugs directly into dartapi_core's PaginatedResponse:

final page = await db.query('users').orderBy('id').paginate(page: 2);
return PaginatedResponse(
  data: page.map(User.fromRow),
  pagination: Pagination(page: page.page, limit: page.limit),
  total: page.total,
);

Constructors

DbPage({required List<Map<String, dynamic>> rows, required int total, required int page, required int limit})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasNext → bool
no setter
hasPrev → bool
no setter
isEmpty → bool
no setter
isNotEmpty → bool
no setter
limit → int
Maximum rows per page.
final
page → int
1-based page number.
final
rows → List<Map<String, dynamic>>
The rows of this page.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
total → int
Total number of rows matching the query across all pages.
final
totalPages → int
no setter

Methods

map<T>(T mapper(Map<String, dynamic> row)) → List<T>
Maps every row of this page to T.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited