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

Add support for TextSpans #13

Merged
merged 1 commit into from
Dec 5, 2019

Conversation

fibbers
Copy link
Contributor

@fibbers fibbers commented Dec 5, 2019

Fixes issue #12.

Experimented locally with this code which rendered the expected result:

Text.rich(TextSpan(
  text: 'Some text',
  children: [
    TextSpan(text: ' and some more text')
        .bold()
        .textColor(Colors.yellow),
  ],
)),

Also, much is copied from the Text extension, since they both use TextStyle.
However, Text has direction/alignment which TextSpan does not.

@fibbers fibbers changed the title Add support for TextSpans, fixing issue #12 Add support for TextSpans Dec 5, 2019
Copy link
Owner

@ReinBentdal ReinBentdal left a comment

Choose a reason for hiding this comment

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

This looks great. Since there is no reason to have the extension named, the extension name can be omitted. I just did this for Text and Icon.
What i mean is extension StyledTextSpan on TextSpan => extension on TextSpan. Also the file has to be exported in styled_widget.dart however this is something i can do aswell.

@fibbers
Copy link
Contributor Author

fibbers commented Dec 5, 2019

Oh, I'm sorry, I think you already made the changes (not that familiar with suggested changes on github).
However, just pushed the requested changes and I added an example on the README, just in case... not sure if that's ok :)

@ReinBentdal ReinBentdal merged commit a0263f6 into ReinBentdal:master Dec 5, 2019
@fibbers fibbers deleted the add_text_span_support branch December 5, 2019 22:19
@ReinBentdal
Copy link
Owner

Nice! Its good you added the example. The documentation is quite lacking at this moment

@ReinBentdal ReinBentdal mentioned this pull request Dec 5, 2019
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

2 participants