chore: Follow up select text

pull/654/head^2
krille-chan 2 years ago
parent c7bdd9269a
commit 9d45f38400
No known key found for this signature in database

@ -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(
constraints: const BoxConstraints( maxWidth: FluffyThemes.columnWidth * 1.5,
maxWidth: FluffyThemes.columnWidth * 1.5, ),
), child: Column(
child: Column( mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ if (event.relationshipType == RelationshipTypes.reply)
if (event.relationshipType == FutureBuilder<Event?>(
RelationshipTypes.reply) future: event.getReplyEvent(timeline),
FutureBuilder<Event?>( builder: (BuildContext context, snapshot) {
future: event.getReplyEvent(timeline), final replyEvent = snapshot.hasData
builder: (BuildContext context, snapshot) { ? snapshot.data!
final replyEvent = snapshot.hasData : Event(
? snapshot.data! eventId: event.relationshipEventId!,
: Event( content: {
eventId: event.relationshipEventId!, 'msgtype': 'm.text',
content: { 'body': '...',
'msgtype': 'm.text', },
'body': '...', senderId: event.senderId,
}, type: 'm.room.message',
senderId: event.senderId, room: event.room,
type: 'm.room.message', status: EventStatus.sent,
room: event.room, originServerTs: DateTime.now(),
status: EventStatus.sent, );
originServerTs: DateTime.now(), return InkWell(
); onTap: () {
return InkWell( if (scrollToEventId != null) {
onTap: () { scrollToEventId!(replyEvent.eventId);
if (scrollToEventId != null) { }
scrollToEventId!(replyEvent.eventId); },
} child: AbsorbPointer(
}, child: Container(
child: AbsorbPointer( margin: const EdgeInsets.symmetric(
child: Container( vertical: 4.0,
margin: const EdgeInsets.symmetric( ),
vertical: 4.0, child: ReplyContent(
), replyEvent,
child: ReplyContent( ownMessage: ownMessage,
replyEvent, timeline: timeline,
ownMessage: ownMessage,
timeline: timeline,
),
), ),
), ),
); ),
}, );
), },
MessageContent(
displayEvent,
textColor: textColor,
onInfoTab: onInfoTab,
), ),
if (event.hasAggregatedEvents( MessageContent(
timeline, displayEvent,
RelationshipTypes.edit, textColor: textColor,
)) onInfoTab: onInfoTab,
Padding( ),
padding: const EdgeInsets.only( if (event.hasAggregatedEvents(
top: 4.0, timeline,
), RelationshipTypes.edit,
child: Row( ))
mainAxisSize: MainAxisSize.min, Padding(
children: [ padding: const EdgeInsets.only(
Icon( top: 4.0,
Icons.edit_outlined, ),
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), color: textColor.withAlpha(164),
size: 14, fontSize: 12,
),
Text(
' - ${displayEvent.originServerTs.localizedTimeShort(context)}',
style: TextStyle(
color: textColor.withAlpha(164),
fontSize: 12,
),
), ),
], ),
), ],
), ),
], ),
), ],
), ),
), ),
), ),

Loading…
Cancel
Save