Skip to content

Commit bc1116c

Browse files
committed
content [nfc]: In UserMention, inline _kDecoration
1 parent 57a3bc4 commit bc1116c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/widgets/content.dart

+4-6
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,10 @@ class UserMention extends StatelessWidget {
812812
@override
813813
Widget build(BuildContext context) {
814814
return Container(
815-
decoration: _kDecoration,
815+
decoration: BoxDecoration(
816+
// TODO(#646) different background between direct and wildcard mentions
817+
color: const HSLColor.fromAHSL(0.2, 240, 0.7, 0.7).toColor(),
818+
borderRadius: const BorderRadius.all(Radius.circular(3))),
816819
padding: const EdgeInsets.symmetric(horizontal: 0.2 * kBaseFontSize),
817820
child: InlineContent(
818821
// If an @-mention is inside a link, let the @-mention override it.
@@ -829,11 +832,6 @@ class UserMention extends StatelessWidget {
829832
nodes: node.nodes));
830833
}
831834

832-
static get _kDecoration => BoxDecoration(
833-
// TODO(#646) different background between direct and wildcard mentions
834-
color: const HSLColor.fromAHSL(0.2, 240, 0.7, 0.7).toColor(),
835-
borderRadius: const BorderRadius.all(Radius.circular(3)));
836-
837835
// This is a more literal translation of Zulip web's CSS.
838836
// But it turns out CSS `box-shadow` has a quirk we rely on there:
839837
// it doesn't apply under the element itself, even if the element's

0 commit comments

Comments
 (0)