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

Color property of textStyleDayButton not Work. #47

Open
SittiphanSittisak opened this issue Apr 5, 2022 · 2 comments
Open

Color property of textStyleDayButton not Work. #47

SittiphanSittisak opened this issue Apr 5, 2022 · 2 comments

Comments

@SittiphanSittisak
Copy link

I tried to change any properties in textStyleDayButton but only the property color did not change. This color of textStyleDayButton always is white.
I test it on Android and the web, and this issue is the same.
How to fix this?

@SittiphanSittisak
Copy link
Author

Has the developer stopped doing it?

@maxmen91
Copy link

maxmen91 commented Jun 16, 2022

I found a workaround:

Provide TextStyle class parameter without color like so in showRoundedDatePicker function:

textStyleDayButton: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 22.0,
),

and in theme parameter provide ThemeData with textTheme and bodyText2 with your desired TextStyle:

textTheme: TextTheme(
bodyText2: TextStyle(color: Colors.white),
),

I guess it works because FlutterRoundedDatePickerDialog checks whether the textstyle has been given and whether it contains color for textStyleDayButton TextStyle. So if we give it a TextStyle but without color it uses color from themeData instead of calculating primarySwatch brightness and setting dayButtonColor according to it.

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

No branches or pull requests

2 participants