QueryResult<T> class

query result class

Constructors

QueryResult({required ResultType type, required List<T> data, String message = '', String? prevCursor, String? nextCursor, bool hasMore = false, bool hasPrev = false, int? tableTotalCount, int? executionTimeMs})
QueryResult.error({ResultType type = ResultType.unknown, String message = ''})
create an error result
factory
QueryResult.success({required List<T> data, String message = '', String? prevCursor, String? nextCursor, bool hasMore = false, bool hasPrev = false, int? tableTotalCount, int? executionTimeMs})
create a success result
factory

Properties

code int
Get the status code value
no setter
data List<T>
query result data
final
executionTimeMs int?
Query execution time in milliseconds.
final
hashCode int
The hash code for this object.
no setterinherited
hasMore bool
Whether there are more results beyond the current page.
final
hasPrev bool
Whether there are results before the current page.
final
isEmpty bool
whether there is data
no setter
isNotEmpty bool
whether there is data
no setter
isSuccess bool
Whether the operation is successful
no setter
length int
get the length of data
no setter
message String
operation message
final
nextCursor String?
Cursor/keyset pagination: opaque token for the next page.
final
prevCursor String?
Cursor/keyset pagination: opaque token for the previous page.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tableTotalCount int?
Estimated total number of records in the entire table (buffer-aware).
final
type ResultType
operation status type
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
for serialization
toString() String
Override toString for easy debugging
override

Operators

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

Static Methods

fromJson(Map<String, dynamic> json) QueryResult<Map<String, dynamic>>
create an instance from json