diff --git a/lib/components/swipeable.dart b/lib/components/swipeable.dart index 71543dc..f876c28 100644 --- a/lib/components/swipeable.dart +++ b/lib/components/swipeable.dart @@ -111,7 +111,7 @@ class Swipeable extends StatefulWidget { final Map dismissThresholds; /// The maximum horizontal offset the item can move to/ - /// + /// /// Represented as a fraction, e.g. if it is 0.4 (the default), then the /// item can be moved at maximum 40% of item's width. final double maxOffset; diff --git a/lib/views/chat.dart b/lib/views/chat.dart index 036ced2..f86fb6b 100644 --- a/lib/views/chat.dart +++ b/lib/views/chat.dart @@ -679,8 +679,11 @@ class _ChatState extends State<_Chat> { child: Swipeable( key: ValueKey(i - 1), background: Container( - color: Theme.of(context).primaryColor.withAlpha(100), - padding: EdgeInsets.symmetric(horizontal: 12.0), + color: Theme.of(context) + .primaryColor + .withAlpha(100), + padding: EdgeInsets.symmetric( + horizontal: 12.0), alignment: Alignment.centerLeft, child: Row( children: [ @@ -710,28 +713,28 @@ class _ChatState extends State<_Chat> { ); } else { setState( - () => - selectedEvents.add(event), + () => selectedEvents + .add(event), + ); + } + selectedEvents.sort( + (a, b) => a.originServerTs + .compareTo( + b.originServerTs), ); } - selectedEvents.sort( - (a, b) => a.originServerTs - .compareTo( - b.originServerTs), - ); - } - }, - scrollToEventId: (String eventId) => - _scrollToEventId(eventId, - context: context), - longPressSelect: - selectedEvents.isEmpty, - selected: selectedEvents - .contains(filteredEvents[i - 1]), - timeline: timeline, - nextEvent: i >= 2 - ? filteredEvents[i - 2] - : null), + }, + scrollToEventId: (String eventId) => + _scrollToEventId(eventId, + context: context), + longPressSelect: + selectedEvents.isEmpty, + selected: selectedEvents.contains( + filteredEvents[i - 1]), + timeline: timeline, + nextEvent: i >= 2 + ? filteredEvents[i - 2] + : null), ), ); });