|
|
|
@ -34,7 +34,7 @@ class Message extends StatelessWidget {
|
|
|
|
|
final bool highlightMarker;
|
|
|
|
|
final bool animateIn;
|
|
|
|
|
final void Function()? resetAnimateIn;
|
|
|
|
|
final Color? avatarPresenceBackgroundColor;
|
|
|
|
|
final bool wallpaperMode;
|
|
|
|
|
|
|
|
|
|
const Message(
|
|
|
|
|
this.event, {
|
|
|
|
@ -52,7 +52,7 @@ class Message extends StatelessWidget {
|
|
|
|
|
this.highlightMarker = false,
|
|
|
|
|
this.animateIn = false,
|
|
|
|
|
this.resetAnimateIn,
|
|
|
|
|
this.avatarPresenceBackgroundColor,
|
|
|
|
|
this.wallpaperMode = false,
|
|
|
|
|
super.key,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -84,7 +84,9 @@ class Message extends StatelessWidget {
|
|
|
|
|
final ownMessage = event.senderId == client.userID;
|
|
|
|
|
final alignment = ownMessage ? Alignment.topRight : Alignment.topLeft;
|
|
|
|
|
|
|
|
|
|
var color = theme.colorScheme.surfaceContainerHigh;
|
|
|
|
|
var color = wallpaperMode
|
|
|
|
|
? theme.colorScheme.surfaceBright
|
|
|
|
|
: theme.colorScheme.surfaceContainerHigh;
|
|
|
|
|
final displayTime = event.type == EventTypes.RoomCreate ||
|
|
|
|
|
nextEvent == null ||
|
|
|
|
|
!event.originServerTs.sameEnvironment(nextEvent!.originServerTs);
|
|
|
|
@ -230,7 +232,7 @@ class Message extends StatelessWidget {
|
|
|
|
|
name: user.calcDisplayname(),
|
|
|
|
|
presenceUserId: user.stateKey,
|
|
|
|
|
presenceBackgroundColor:
|
|
|
|
|
avatarPresenceBackgroundColor,
|
|
|
|
|
wallpaperMode ? Colors.transparent : null,
|
|
|
|
|
onTap: () => onAvatarTab(event),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
@ -265,23 +267,20 @@ class Message extends StatelessWidget {
|
|
|
|
|
? displayname.color
|
|
|
|
|
: displayname
|
|
|
|
|
.lightColorText),
|
|
|
|
|
shadows:
|
|
|
|
|
avatarPresenceBackgroundColor ==
|
|
|
|
|
null
|
|
|
|
|
? null
|
|
|
|
|
: [
|
|
|
|
|
Shadow(
|
|
|
|
|
offset:
|
|
|
|
|
const Offset(
|
|
|
|
|
0.0,
|
|
|
|
|
0.0,
|
|
|
|
|
),
|
|
|
|
|
blurRadius: 5,
|
|
|
|
|
color: theme
|
|
|
|
|
.colorScheme
|
|
|
|
|
.surface,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
shadows: !wallpaperMode
|
|
|
|
|
? null
|
|
|
|
|
: [
|
|
|
|
|
Shadow(
|
|
|
|
|
offset: const Offset(
|
|
|
|
|
0.0,
|
|
|
|
|
0.0,
|
|
|
|
|
),
|
|
|
|
|
blurRadius: 5,
|
|
|
|
|
color: theme
|
|
|
|
|
.colorScheme
|
|
|
|
|
.surface,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
@ -309,13 +308,26 @@ class Message extends StatelessWidget {
|
|
|
|
|
: 1,
|
|
|
|
|
duration: FluffyThemes.animationDuration,
|
|
|
|
|
curve: FluffyThemes.animationCurve,
|
|
|
|
|
child: Material(
|
|
|
|
|
color:
|
|
|
|
|
noBubble ? Colors.transparent : color,
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: ownMessage
|
|
|
|
|
? null
|
|
|
|
|
: noBubble
|
|
|
|
|
? Colors.transparent
|
|
|
|
|
: color,
|
|
|
|
|
borderRadius: borderRadius,
|
|
|
|
|
gradient: ownMessage && !noBubble
|
|
|
|
|
? LinearGradient(
|
|
|
|
|
colors: [
|
|
|
|
|
theme.colorScheme.primary,
|
|
|
|
|
theme.colorScheme.secondary,
|
|
|
|
|
],
|
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
|
end: Alignment.bottomRight,
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
),
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
|