resolve method
Returns a text attribute value that can depend on context
.
Implementation
@override
TextAttributeValue resolve(BuildContext context) {
final theme = AttributeTheme.of(context);
final style = theme.linkStyle ??
const TextStyle(decoration: TextDecoration.underline);
final onTap = theme.linkOnTap;
if (kDebugMode && onTap == null) {
// ignore: avoid_print
print(
'WARNING: onTap handler for LinkAttribute not set on AttributeTheme.');
}
return TextAttributeValue(
debugName: 'link<$uri>',
style: style,
onTap: onTap == null ? null : () => onTap(context, uri),
);
}