Skip to content

[material_ui] Properly document alwaysUse24HourFormat in MediaQuery #89744

Open

Description

@TodorGinchev

Use case

The showTimePicker API accepts a boolean input called alwaysUse24HourFormat that is used to control the input time clock being displayed in 12 hour (am/pm) or 24 hour format.

Expected behaviour

When time picker is invoked with alwaysUse24HourFormat set to false, the input time clock should "not always have 24 hour format", and therefore should obey the locale (if locale uses 24 hour clock, so should the clock even when alwaysUse24HourFormat=false ).

Actual behaviour

When time picker is invoked with alwaysUse24HourFormat set to false, the input time clock "always has 12 hour format", regardless of the locale.

Proposal

Rename alwaysUse24HourFormat to use24HourFormat to avoid confusion. In that way, it is clear that use24HourFormat=false means that 12h format is always used / enforced.

If that is not possible, the current behaviour of alwaysUse24HourFormat should at least be documented.

Activity

  1. danagbemava-nc commented on Sep 9, 2021

    @danagbemava-nc
    Member

    Hi @TodorGinchev, thanks for the proposal.

    I can't seem to find the alwaysUse24HourFormat property on the showTimePicker. Do you mind pointing that out for me in the docs?

    Thank you

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 9, 2021
  3. TodorGinchev commented on Sep 9, 2021

    @TodorGinchev
    ContributorAuthor

    Apologies, it is not directly supported through the showTimePicker API, this is how you can set the value of alwaysUse24HourFormat:

    await showTimePicker(
          context: context,
          initialTime: TimeOfDay.now(),
          builder: (BuildContext context, Widget? child) {
            return MediaQuery(
              data: MediaQuery.of(context).copyWith(
                alwaysUse24HourFormat: false,
              ),
              child: child!,
            );
          },
        );
    
  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 9, 2021
  5. changed the title [-]alwaysUse24HourFormat in showTimePicker() should be renamed[/-] [+]alwaysUse24HourFormat in MediaQuery should be renamed[/+] on Sep 9, 2021
  6. added
    a: internationalizationSupporting other languages or locales. (aka i18n)
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: proposalA detailed proposal for a change to Flutter
    c: new featureNothing broken; request for a new capability
    and removed
    in triagePresently being triaged by the triage team
    on Sep 10, 2021
  7. arq0017 commented on Sep 15, 2021

    @arq0017

    Hi @TodorGinchev, I am new to the community and I would like to contribute to this issue. According to your proposal, I could Rename alwaysUse24HourFormat to use24HourFormat to avoid confusion.

  8. 2 remaining items

  9. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  10. flutter-triage-bot commented on Sep 20, 2026

    @flutter-triage-bot

    This issue is missing a priority label. Please set a priority label when adding the triaged-design label.

  11. changed the title [-]alwaysUse24HourFormat in MediaQuery should be renamed[/-] [+][material_ui] Properly document alwaysUse24HourFormat in MediaQuery[/+] on Sep 22, 2026
  12. added
    P2Important issues not at the top of the work list
    triaged-designTriaged by Design Languages team
    and removed
    c: new featureNothing broken; request for a new capability
    on Sep 22, 2026
  13. dkwingsmt commented on Sep 22, 2026

    @dkwingsmt
    Contributor

    I agree with @/goderbauer 's comment:

    I don't think the API churn that falls out of this rename is worth it. If necessary, we can update the doc on the property to make it clearer what this means.

    Feel free to send a PR to better document this property. Thanks!

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

    P2Important issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)c: proposalA detailed proposal for a change to Flutterd: api docsIssues with https://api.flutter.dev/p: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions