From 71a3c8b7b915c801c86b1e8d814edf41012333fe Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Fri, 2 Sep 2022 12:20:40 -0400 Subject: [PATCH] Fix misaligned chat names (#187) --- lib/models/irc.dart | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/lib/models/irc.dart b/lib/models/irc.dart index ae5a1624..d73b62ff 100644 --- a/lib/models/irc.dart +++ b/lib/models/irc.dart @@ -285,22 +285,15 @@ class IRCMessage { } } - // Printing template for debugging purposes. - // debugPrint('OLD - NAME: ${tags['display-name']!}, HUE: ${hsl.hue}, SATURATION: ${hsl.saturation}, LIGHNTESS: ${hsl.lightness}'); - // debugPrint('NEW - NAME: ${tags['display-name']!}, HUE: ${hsl.hue}, SATURATION: ${hsl.saturation}, LIGHNTESS: ${hsl.lightness}'); - + // Add the display name (username) to the span and apply the onLongPressName callback. span.add( - WidgetSpan( - child: InkWell( - onLongPress: onLongPressName, - child: Text( - tags['display-name']!, - style: TextStyle( - color: color, - fontWeight: FontWeight.bold, - ), - ), + TextSpan( + text: tags['display-name']!, + style: TextStyle( + color: color, + fontWeight: FontWeight.bold, ), + recognizer: LongPressGestureRecognizer()..onLongPress = onLongPressName, ), );