You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text widget to change its colour and fontSize without using TextStyle #61690
I believe new developers has benefitted from the readability of the 'out of the box' colour parameter in container. Therefore, I am proposing the same with the commonly used Text widget.
Colour changes in Container widget has been introduced as follows:
Is the reason for container out of the box colour parameter better readability and ease of understanding for new Flutter developers? Otherwise, what's the reason?
However, text widget has no colour parameter out of the box. To change a colour, you have to type an additional object.
Have the text widget to have a colour and fontSize parameters without using TextStyle. These two parameters I believe is the most used parameters in the Text widget.
@darshankawar I would like to work on this proposal, can you guide me a bit? TextStyle property should not change, only color and fontSize is to be added for Text, am I right?
I am going to close this since it is very unlikely we will do this. I have added it to the list in #24722 where we keep track of API improvements that would be nice, but we are not likely to make.
We could have both, and an assert that says "you can't define both, you need to choose only color or a TextStyle". I believe other widgets have mechanisms like this.
Also the changes on Text should be very small, as we just need to create a TextStyle if a color was defined, and keep the same underlying code unchanged, just the constructor would be affected.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Pragya007 commentedon Jul 18, 2020
@darshankawar I would like to work on this proposal, can you guide me a bit? TextStyle property should not change, only color and fontSize is to be added for Text, am I right?
flutter-triage-bot commentedon Jul 16, 2024
This issue is missing a priority label. Please set a priority label when adding the
triaged-designlabel.Piinks commentedon Jul 18, 2024
I am going to close this since it is very unlikely we will do this. I have added it to the list in #24722 where we keep track of API improvements that would be nice, but we are not likely to make.
feinstein commentedon Jul 19, 2024
We could have both, and an assert that says "you can't define both, you need to choose only color or a TextStyle". I believe other widgets have mechanisms like this.
Also the changes on Text should be very small, as we just need to create a TextStyle if a color was defined, and keep the same underlying code unchanged, just the constructor would be affected.
github-actions commentedon Aug 2, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.