Order gym sets by created

This commit is contained in:
Brandon Presley 2023-11-10 16:16:28 +13:00
parent da59790796
commit 305ecd20eb

View File

@ -37,6 +37,9 @@ class _SetList extends State<SetList> {
Future<void> fetch(int pageKey) async {
final gymSets = await (db.select(db.gymSets)
..where((gymSet) => gymSet.name.contains(widget.search))
..orderBy([
(u) => OrderingTerm(expression: u.created, mode: OrderingMode.desc),
])
..limit(10, offset: pageKey * 10))
.get();