-
Notifications
You must be signed in to change notification settings - Fork 127
Description
Is your feature request related to a problem? Please describe.
Currently, LinkConfig only supports a static style for all links. This limits customization when different links need different styles (for example, external vs. internal links). I'm unable to dynamically adjust the text style based on the link target or content.
Describe the solution you'd like
Add a TextStyle? Function(String url)? styleBuilder property to LinkConfig.
When provided, styleBuilder should be called with the link URL to determine the style for that specific link.
If styleBuilder is not set, the existing style property should continue to be used as a fallback.
This would not be a breaking change, as it extends current behavior without modifying existing APIs.
Additional context
Example usage:
LinkConfig(
styleBuilder: (url) {
if (url.startsWith('https://internal.example.com')) {
return const TextStyle(color: Colors.green);
}
return const TextStyle(color: Colors.blueAccent);
},
)This would allow flexible styling of links while preserving backward compatibility.