From a00246c1c0ac3bbef4a5699718d9d94ee986af80 Mon Sep 17 00:00:00 2001 From: Lars Refsgaard <1552887+LarsRefsgaard@users.noreply.github.com> Date: Tue, 25 Jul 2023 10:26:05 +0200 Subject: [PATCH] Fix reversed ordering on about page --- lib/ui/pages/study_page.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ui/pages/study_page.dart b/lib/ui/pages/study_page.dart index 4ce30945..005d6f54 100644 --- a/lib/ui/pages/study_page.dart +++ b/lib/ui/pages/study_page.dart @@ -20,6 +20,9 @@ class StudyPageState extends State { image: 'assets/images/kids.png', ); + // reverse the ordering of the messages + widget.model.messages.sort((a, b) => b.timestamp.compareTo(a.timestamp)); + return Scaffold( backgroundColor: Theme.of(context).colorScheme.secondary, body: SafeArea( @@ -50,7 +53,7 @@ class StudyPageState extends State { } return _aboutStudyCard( - context, bloc.messages[index - 1]); + context, widget.model.messages[index - 1]); }, ), );