From 305ecd20eb9be5ad0350f14ae23baf09db5f8f0b Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Fri, 10 Nov 2023 16:16:28 +1300 Subject: [PATCH] Order gym sets by created --- lib/set_list.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/set_list.dart b/lib/set_list.dart index 7f3cd36..f2604cd 100644 --- a/lib/set_list.dart +++ b/lib/set_list.dart @@ -37,6 +37,9 @@ class _SetList extends State { Future 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();