-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Possibility to create a base style as to not repeat #24
Comments
Hi @linxydmhg the second example is similar to a previous pull-request that I have made that was rejected by @ReinBentdal #17. All of this can be accomplished with your own code by adding an extension method like I did in the pull request, without the need to change the library. |
@linxydmhg Here is a snippet to get you started
|
A way to achieve what you want is by doing this: final styledText = (String data) => Text(data)
.fontSize(16)
.fontWeight(FontWeight.w600)
.textColor(Colors.black);
styledText('NAME')
styledText('AGE') |
@ReinBentdal That works out perfectly. |
I saw its possible to use the Styled.widget(child) in the example, but this does not seem have the methods that are available for Text e.g. textColor().
Imagine we had something like above, it seems redundant to repeat ourselves. Is there a possibility to create a base style that can be applied to all Text widgets
e.g.
or
The text was updated successfully, but these errors were encountered: