simplified code across the app and consolidated duplicated helpers
This commit is contained in:
@@ -62,14 +62,12 @@ class HighlightedLinkify extends StatefulWidget {
|
||||
final String? highlight;
|
||||
final LinkCallback? onOpen;
|
||||
final TextStyle? style;
|
||||
final TextStyle? linkStyle;
|
||||
|
||||
const HighlightedLinkify({
|
||||
required this.text,
|
||||
this.highlight,
|
||||
this.onOpen,
|
||||
this.style,
|
||||
this.linkStyle,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@@ -126,11 +124,7 @@ class _HighlightedLinkifyState extends State<HighlightedLinkify> {
|
||||
// drops link color/underline because TextStyle.merge treats explicit
|
||||
// nulls in the overlay as "leave unchanged".
|
||||
final linkStyle = defaultStyle.merge(
|
||||
widget.linkStyle ??
|
||||
const TextStyle(
|
||||
color: Colors.blue,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
const TextStyle(color: Colors.blue, decoration: TextDecoration.underline),
|
||||
);
|
||||
const linkHighlight = TextStyle(
|
||||
backgroundColor: Color(0xFFFFD54F),
|
||||
|
||||
Reference in New Issue
Block a user