Skip to content

Unclear how to change colors of time picker(showTimePicker) #56465

Closed

Description

@gintasz

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.
image

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$ 

Activity

  1. added
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    on May 7, 2020
  2. HansMuller commented on May 7, 2020

    @HansMuller
    Contributor
  3. rami-a commented on May 7, 2020

    @rami-a
    Contributor

    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

  4. rami-a commented on Jun 23, 2020

    @rami-a
    Contributor

    Hello @gintasz, I just submitted #59191 that adds a time picker theme that allows you to customize the various colors, closing this now :)

  5. DriftingShadows commented on Aug 6, 2020

    @DriftingShadows

    @rami-a How does one change the button ('Cancel', 'OK') colours?

  6. rami-a commented on Aug 6, 2020

    @rami-a
    Contributor

    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.

  7. DriftingShadows commented on Aug 7, 2020

    @DriftingShadows

    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?

  8. rami-a commented on Aug 7, 2020

    @rami-a
    Contributor

    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.

  9. github-actions commented on Aug 18, 2021

    @github-actions

    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.

  10. locked as resolved and limited conversation to collaborators on Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions