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
Unclear how to change colors of time picker(showTimePicker) #56465
At the moment it is very unclear how to change the colors of showTimePicker, e.g. the red handle color. Don't find answers even on google. Suggesting to document it more clearly or add appropriate arguments to showTimePicker for management of its colors.
gintas-mac:domukpizzaapp gintas$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.18.0-10.0.pre, on Mac OS X 10.15.4 19E287, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[!] VS Code (version 1.43.2)
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (3 available)
! Doctor found issues in 1 category.
gintas-mac:domukpizzaapp gintas$
Hi @gintasz I'm currently working on a revamp of TimePicker to support better theming but it's still a WIP (hope to have it ready in the coming weeks). Currently, the picker gets the red color from your ThemeData.accentColor, so customizing that would change this. Hope this helps
Hello @DriftingShadows, the time picker uses the new TextButtons as of #61492 and the easiest way to change the color of those buttons is to specify a textButtonTheme on your ThemeData. Hope that helps.
Hello @DriftingShadows, the time picker uses the new TextButtons as of #61492 and the easiest way to change the color of those buttons is to specify a textButtonTheme on your ThemeData. Hope that helps.
Thanks for that. I swear I'm on the latest flutter version (v1.20). TextButton isnt a widget for me (and as such textButtonTheme isnt a thing either). Am I doing something wrong?
Ah I believe the TextButton change has not landed in stable yet, so then the TimePicker is using FlatButtons, which you can adjust the color of by using ButtonTheme. If you only want to change the TimePicker's button colors, you can use the builder param of showTimePicker and wrap the widget with a custom Theme.
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
HansMuller commentedon May 7, 2020
CC @rami-a @darrenaustin
rami-a commentedon May 7, 2020
Hi @gintasz I'm currently working on a revamp of TimePicker to support better theming but it's still a WIP (hope to have it ready in the coming weeks). Currently, the picker gets the red color from your
ThemeData.accentColor, so customizing that would change this. Hope this helpsrami-a commentedon Jun 23, 2020
Hello @gintasz, I just submitted #59191 that adds a time picker theme that allows you to customize the various colors, closing this now :)
DriftingShadows commentedon Aug 6, 2020
@rami-a How does one change the button ('Cancel', 'OK') colours?
rami-a commentedon Aug 6, 2020
Hello @DriftingShadows, the time picker uses the new TextButtons as of #61492 and the easiest way to change the color of those buttons is to specify a
textButtonThemeon yourThemeData. Hope that helps.DriftingShadows commentedon Aug 7, 2020
Thanks for that. I swear I'm on the latest flutter version (v1.20). TextButton isnt a widget for me (and as such textButtonTheme isnt a thing either). Am I doing something wrong?
rami-a commentedon Aug 7, 2020
Ah I believe the
TextButtonchange has not landed in stable yet, so then the TimePicker is usingFlatButtons, which you can adjust the color of by usingButtonTheme. If you only want to change the TimePicker's button colors, you can use thebuilderparam ofshowTimePickerand wrap the widget with a custom Theme.github-actions commentedon Aug 18, 2021
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.