fix formatting

This commit is contained in:
Inex Code 2020-10-04 23:37:32 +00:00
parent b6c3506126
commit 20efc3dbb6
2 changed files with 26 additions and 23 deletions

View File

@ -111,7 +111,7 @@ class Swipeable extends StatefulWidget {
final Map<SwipeDirection, double> dismissThresholds; final Map<SwipeDirection, double> dismissThresholds;
/// The maximum horizontal offset the item can move to/ /// The maximum horizontal offset the item can move to/
/// ///
/// Represented as a fraction, e.g. if it is 0.4 (the default), then the /// 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. /// item can be moved at maximum 40% of item's width.
final double maxOffset; final double maxOffset;

View File

@ -679,8 +679,11 @@ class _ChatState extends State<_Chat> {
child: Swipeable( child: Swipeable(
key: ValueKey(i - 1), key: ValueKey(i - 1),
background: Container( background: Container(
color: Theme.of(context).primaryColor.withAlpha(100), color: Theme.of(context)
padding: EdgeInsets.symmetric(horizontal: 12.0), .primaryColor
.withAlpha(100),
padding: EdgeInsets.symmetric(
horizontal: 12.0),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Row( child: Row(
children: [ children: [
@ -710,28 +713,28 @@ class _ChatState extends State<_Chat> {
); );
} else { } else {
setState( setState(
() => () => selectedEvents
selectedEvents.add(event), .add(event),
);
}
selectedEvents.sort(
(a, b) => a.originServerTs
.compareTo(
b.originServerTs),
); );
} }
selectedEvents.sort( },
(a, b) => a.originServerTs scrollToEventId: (String eventId) =>
.compareTo( _scrollToEventId(eventId,
b.originServerTs), context: context),
); longPressSelect:
} selectedEvents.isEmpty,
}, selected: selectedEvents.contains(
scrollToEventId: (String eventId) => filteredEvents[i - 1]),
_scrollToEventId(eventId, timeline: timeline,
context: context), nextEvent: i >= 2
longPressSelect: ? filteredEvents[i - 2]
selectedEvents.isEmpty, : null),
selected: selectedEvents
.contains(filteredEvents[i - 1]),
timeline: timeline,
nextEvent: i >= 2
? filteredEvents[i - 2]
: null),
), ),
); );
}); });