chore: Follow up select text

This commit is contained in:
krille-chan 2023-11-06 20:01:52 +01:00
commit 9d45f38400
No known key found for this signature in database

View file

@ -191,102 +191,99 @@ class Message extends StatelessWidget {
Container( Container(
alignment: alignment, alignment: alignment,
padding: const EdgeInsets.only(left: 8), padding: const EdgeInsets.only(left: 8),
child: IgnorePointer( child: Material(
child: Material( color: noBubble ? Colors.transparent : color,
color: noBubble ? Colors.transparent : color, borderRadius: borderRadius,
borderRadius: borderRadius, clipBehavior: Clip.antiAlias,
clipBehavior: Clip.antiAlias, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius:
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
BorderRadius.circular(AppConfig.borderRadius), ),
), padding: noBubble || noPadding
padding: noBubble || noPadding ? EdgeInsets.zero
? EdgeInsets.zero : const EdgeInsets.symmetric(
: const EdgeInsets.symmetric( horizontal: 16,
horizontal: 16, vertical: 8,
vertical: 8,
),
constraints: const BoxConstraints(
maxWidth: FluffyThemes.columnWidth * 1.5,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (event.relationshipType ==
RelationshipTypes.reply)
FutureBuilder<Event?>(
future: event.getReplyEvent(timeline),
builder: (BuildContext context, snapshot) {
final replyEvent = snapshot.hasData
? snapshot.data!
: Event(
eventId: event.relationshipEventId!,
content: {
'msgtype': 'm.text',
'body': '...',
},
senderId: event.senderId,
type: 'm.room.message',
room: event.room,
status: EventStatus.sent,
originServerTs: DateTime.now(),
);
return InkWell(
onTap: () {
if (scrollToEventId != null) {
scrollToEventId!(replyEvent.eventId);
}
},
child: AbsorbPointer(
child: Container(
margin: const EdgeInsets.symmetric(
vertical: 4.0,
),
child: ReplyContent(
replyEvent,
ownMessage: ownMessage,
timeline: timeline,
),
),
),
);
},
),
MessageContent(
displayEvent,
textColor: textColor,
onInfoTab: onInfoTab,
), ),
if (event.hasAggregatedEvents( constraints: const BoxConstraints(
timeline, maxWidth: FluffyThemes.columnWidth * 1.5,
RelationshipTypes.edit, ),
)) child: Column(
Padding( mainAxisSize: MainAxisSize.min,
padding: const EdgeInsets.only( crossAxisAlignment: CrossAxisAlignment.start,
top: 4.0, children: <Widget>[
), if (event.relationshipType == RelationshipTypes.reply)
child: Row( FutureBuilder<Event?>(
mainAxisSize: MainAxisSize.min, future: event.getReplyEvent(timeline),
children: [ builder: (BuildContext context, snapshot) {
Icon( final replyEvent = snapshot.hasData
Icons.edit_outlined, ? snapshot.data!
color: textColor.withAlpha(164), : Event(
size: 14, eventId: event.relationshipEventId!,
), content: {
Text( 'msgtype': 'm.text',
' - ${displayEvent.originServerTs.localizedTimeShort(context)}', 'body': '...',
style: TextStyle( },
color: textColor.withAlpha(164), senderId: event.senderId,
fontSize: 12, type: 'm.room.message',
room: event.room,
status: EventStatus.sent,
originServerTs: DateTime.now(),
);
return InkWell(
onTap: () {
if (scrollToEventId != null) {
scrollToEventId!(replyEvent.eventId);
}
},
child: AbsorbPointer(
child: Container(
margin: const EdgeInsets.symmetric(
vertical: 4.0,
),
child: ReplyContent(
replyEvent,
ownMessage: ownMessage,
timeline: timeline,
), ),
), ),
], ),
), );
},
),
MessageContent(
displayEvent,
textColor: textColor,
onInfoTab: onInfoTab,
),
if (event.hasAggregatedEvents(
timeline,
RelationshipTypes.edit,
))
Padding(
padding: const EdgeInsets.only(
top: 4.0,
), ),
], child: Row(
), mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.edit_outlined,
color: textColor.withAlpha(164),
size: 14,
),
Text(
' - ${displayEvent.originServerTs.localizedTimeShort(context)}',
style: TextStyle(
color: textColor.withAlpha(164),
fontSize: 12,
),
),
],
),
),
],
), ),
), ),
), ),