File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
demos/supabase-todolist/lib/models Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ class TodoList {
3737 /// Watch all lists.
3838 static Stream <List <TodoList >> watchLists () {
3939 // This query is automatically re-run when data in "lists" or "todos" is modified.
40- return db.watch ('SELECT * FROM lists ORDER BY created_at' ).map ((results) {
40+ return db
41+ .watch ('SELECT * FROM lists ORDER BY created_at, id' )
42+ .map ((results) {
4143 return results.map (TodoList .fromRow).toList (growable: false );
4244 });
4345 }
@@ -71,7 +73,7 @@ class TodoList {
7173 /// Watch items within this list.
7274 Stream <List <TodoItem >> watchItems () {
7375 return db.watch (
74- 'SELECT * FROM todos WHERE list_id = ? ORDER BY created_at DESC' ,
76+ 'SELECT * FROM todos WHERE list_id = ? ORDER BY created_at DESC, id ' ,
7577 parameters: [id]).map ((event) {
7678 return event.map (TodoItem .fromRow).toList (growable: false );
7779 });
You can’t perform that action at this time.
0 commit comments