feat: Show time on message groups
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled

This commit is contained in:
Alexey 2026-03-25 15:43:20 +03:00
commit 5931f4733f

View file

@ -102,10 +102,12 @@ class Message extends StatelessWidget {
final alignment = ownMessage ? Alignment.topRight : Alignment.topLeft; final alignment = ownMessage ? Alignment.topRight : Alignment.topLeft;
var color = theme.colorScheme.surfaceContainerHigh; var color = theme.colorScheme.surfaceContainerHigh;
final timeString = event.originServerTs.localizedTime(context);
final displayTime = final displayTime =
event.type == EventTypes.RoomCreate || event.type == EventTypes.RoomCreate ||
nextEvent == null || nextEvent == null ||
!event.originServerTs.sameEnvironment(nextEvent!.originServerTs); !event.originServerTs.sameEnvironment(nextEvent!.originServerTs) ||
nextEvent != null && timeString != nextEvent!.originServerTs.localizedTime(context);
final nextEventSameSender = final nextEventSameSender =
nextEvent != null && nextEvent != null &&
{ {
@ -249,7 +251,7 @@ class Message extends StatelessWidget {
vertical: 2.0, vertical: 2.0,
), ),
child: Text( child: Text(
event.originServerTs.localizedTime(context), timeString,
style: TextStyle( style: TextStyle(
fontSize: 12 * AppSettings.fontSizeFactor.value, fontSize: 12 * AppSettings.fontSizeFactor.value,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,