Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default text style for colorClickableText #35

Merged
merged 2 commits into from Mar 27, 2024

Conversation

takinok
Copy link
Contributor

@takinok takinok commented Jul 24, 2022

The "style" and "moreStyle/lessStyle" arguments can be null. In that case, there is a problem that "colorClickableText" is not effective.
As you can see below, if the "style" is null, "effectiveTextStyle" will be null, and also "_defaultMoreStyle" will be null. This means "colorClickableText" is not effective.

This PR might be related with #20 .

Widget build(BuildContext context) {
    final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context);
    TextStyle? effectiveTextStyle = widget.style;
    if (widget.style?.inherit ?? false) {
      effectiveTextStyle = defaultTextStyle.style.merge(widget.style);
    } 
   ...
    final _defaultMoreStyle = widget.moreStyle ??
        effectiveTextStyle?.copyWith(color: colorClickableText);

Copy link

@pranavo72bex pranavo72bex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jonataslaw jonataslaw changed the base branch from master to 2.2.0 March 27, 2024 22:45
@jonataslaw jonataslaw merged commit fb13eee into jonataslaw:2.2.0 Mar 27, 2024
jonataslaw added a commit that referenced this pull request Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants