Skip to content

Commit 17453cc

Browse files
committed
content [nfc]: In UserMention, inline _kDecoration
1 parent f3353ec commit 17453cc

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
@@ -894,7 +894,10 @@ class UserMention extends StatelessWidget {
894894
@override
895895
Widget build(BuildContext context) {
896896
return Container(
897-
decoration: _kDecoration,
897+
decoration: BoxDecoration(
898+
// TODO(#646) different background between direct and wildcard mentions
899+
color: const HSLColor.fromAHSL(0.2, 240, 0.7, 0.7).toColor(),
900+
borderRadius: const BorderRadius.all(Radius.circular(3))),
898901
padding: const EdgeInsets.symmetric(horizontal: 0.2 * kBaseFontSize),
899902
child: InlineContent(
900903
// If an @-mention is inside a link, let the @-mention override it.
@@ -911,11 +914,6 @@ class UserMention extends StatelessWidget {
911914
nodes: node.nodes));
912915
}
913916

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

0 commit comments

Comments
 (0)