Using isBetween
#1070
Replies: 1 comment 1 reply
-
To fix your example, you would also have to use Future<List<Book>> getLimitedBooks(int limit, {int offset = 0})
=>(select(books)
..where((t) => t.srno.isBetweenValues(offset, offset+limit))
..limit(limit)).get(); But Future<List<Book>> getLimitedBooks(int limit, {int offset = 0})
=>(select(books)..limit(limit, offset: offset)).get(); I would recommend to always use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was trying to limit the number of rows I fetch from the DB so that I could paginate in the front end. When I try to use the above, I get this error in the IDE: ''error: This expression has a type of 'void' so its value can't be used. (use_of_void_result at ...) for :
The below works without any issues:
Future<List<Book>> getFavoriteBooks() => (select(books)..where((t) => t.favorite.equals(1))).get();
Any inputs on what I could be doing wrong? Error comes with both isBetween and isBetweenValues
Beta Was this translation helpful? Give feedback.
All reactions