Skip to content

docs: Document MediaQueryData.alwaysUse24HourFormat on macOS, Windows, Linux, web (#160664)#186642

Merged
auto-submit[bot] merged 5 commits into
flutter:masterfrom
NadeemIqbal:nadeem/160664-alwaysUse24HourFormat-docs
May 28, 2026
Merged

docs: Document MediaQueryData.alwaysUse24HourFormat on macOS, Windows, Linux, web (#160664)#186642
auto-submit[bot] merged 5 commits into
flutter:masterfrom
NadeemIqbal:nadeem/160664-alwaysUse24HourFormat-docs

Conversation

@NadeemIqbal
Copy link
Copy Markdown
Contributor

@NadeemIqbal NadeemIqbal commented May 17, 2026

MediaQueryData.alwaysUse24HourFormat's dartdoc previously documented only Android and iOS behavior. Extended the platform-behavior list to cover macOS, Windows, Linux, and web, mirroring what the engine reports for each: FlutterHourFormat.isAlwaysUse24HourFormat on macOS, GetUserTimeFormat()/Prefer24HourTime() on Windows, org.gnome.desktop.interface.clock-format on Linux/GNOME, and a hard false default in the web engine's platform_dispatcher.dart.

Fixes #160664.

Pre-launch Checklist

Documentation-only change, so I am claiming the test-exempt policy.

…, Linux, web

The platform behavior list previously only covered Android and iOS. Extend it
to describe what the value reflects on macOS (system locale time format),
Windows (Region "Short time" format), Linux (desktop clock-format setting,
e.g. org.gnome.desktop.interface.clock-format on GNOME), and web (always
false).

Fixes flutter#160664.
@github-actions github-actions Bot added the framework flutter/packages/flutter repository. See also f: labels. label May 17, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for MediaQueryData.alwaysUse24HourFormat to describe its behavior on macOS, Windows, Linux, and web. A review comment identifies an inaccuracy regarding the web platform's API availability and suggests more precise wording for the documentation.

Comment on lines +593 to +594
/// - On web this flag is always false. The web platform does not provide
/// an API for retrieving the user's preferred time format.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The claim that the web platform lacks an API for this is inaccurate; the Intl.DateTimeFormat API (specifically resolvedOptions().hourCycle) allows browsers to expose the user's preferred hour cycle. It is more accurate to state that the Flutter web engine does not currently support or populate this field based on browser settings.

  /// - On web this flag is always false. The web engine does not currently
  ///   support retrieving the user's preferred time format.
References
  1. Documentation should be useful and accurate, explaining the why and the how correctly. (link)

Address review feedback (flutter#186642): browsers do expose a preferred hour cycle
via Intl.DateTimeFormat.resolvedOptions().hourCycle, but the Flutter web
engine does not currently consume it. Reword the bullet so it does not
overstate the platform limitation.
Comment thread packages/flutter/lib/src/widgets/media_query.dart Outdated
Copy link
Copy Markdown
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the contribution!

@AbdeMohlbi AbdeMohlbi added the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2026
@auto-submit
Copy link
Copy Markdown
Contributor

auto-submit Bot commented May 28, 2026

auto label is removed for flutter/flutter/186642, Failed to enqueue flutter/flutter/186642 with HTTP 400: Pull request Required status check "Merge Queue Guard" is expected..

@AbdeMohlbi AbdeMohlbi added the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2026
@auto-submit
Copy link
Copy Markdown
Contributor

auto-submit Bot commented May 28, 2026

auto label is removed for flutter/flutter/186642, Failed to enqueue flutter/flutter/186642 with HTTP 400: Pull request Required status check "Merge Queue Guard" is expected..

@Piinks
Copy link
Copy Markdown
Contributor

Piinks commented May 28, 2026

@AbdeMohlbi the CICD label is what is missing. :)

@Piinks Piinks added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels May 28, 2026
@AbdeMohlbi
Copy link
Copy Markdown
Member

@AbdeMohlbi the CICD label is what is missing. :)

i think i need a new set of eyes these are not working anymore ;)

@auto-submit auto-submit Bot added this pull request to the merge queue May 28, 2026
Merged via the queue into flutter:master with commit 2fabeff May 28, 2026
94 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request May 29, 2026
flutter/flutter@e70534d...b05a9d7

2026-05-29 engine-flutter-autoroll@skia.org Roll Skia from 47155534833e to d9d6b440c4e7 (1 revision) (flutter/flutter#187301)
2026-05-29 engine-flutter-autoroll@skia.org Roll Skia from f93ed13d77fb to 47155534833e (4 revisions) (flutter/flutter#187291)
2026-05-29 kevmoo@users.noreply.github.com [web_ui] Optimize skwasm text layout and path decoding to eliminate dynamic boxing churn under Wasm (flutter/flutter#186978)
2026-05-29 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from SBpmmPxqx3lAvGojE... to jMR_VXQi07kAk8vbR... (flutter/flutter#187279)
2026-05-29 burak.karahan@mail.ru Remove Material import from sliver tree rendering test (flutter/flutter#187000)
2026-05-29 bdero@google.com [Impeller] Remove the y_coord_scale Y-flip plumbing (flutter/flutter#187224)
2026-05-29 31859944+LongCatIsLooong@users.noreply.github.com Add/remove overlay child RenderObject from the tree in `attach`/`detach` (flutter/flutter#186564)
2026-05-29 engine-flutter-autoroll@skia.org Roll Skia from fcfe5975c945 to f93ed13d77fb (4 revisions) (flutter/flutter#187273)
2026-05-28 evanwall@buffalo.edu Handle complex RSE rendering in the uber SDF pipeline (flutter/flutter#186434)
2026-05-28 engine-flutter-autoroll@skia.org Roll Dart SDK from 082191101fcc to 683322426411 (2 revisions) (flutter/flutter#187270)
2026-05-28 mvincentong@gmail.com Clarify route transition animations (flutter/flutter#186552)
2026-05-28 116356835+AbdeMohlbi@users.noreply.github.com document that the default Key is null and explain proper usage in list diffing (flutter/flutter#185197)
2026-05-28 srawlins@google.com [flutter_tools] Use super parameters in missed spots (flutter/flutter#186197)
2026-05-28 mr_nadeem_iqbal@yahoo.com docs: Document MediaQueryData.alwaysUse24HourFormat on macOS, Windows, Linux, web (#160664) (flutter/flutter#186642)
2026-05-28 engine-flutter-autoroll@skia.org Roll Skia from 5493e4c144cd to fcfe5975c945 (3 revisions) (flutter/flutter#187256)
2026-05-28 30870216+gaaclarke@users.noreply.github.com Shares opengles golden context (flutter/flutter#187243)
2026-05-28 jason-simmons@users.noreply.github.com Update the Curl CIPD package in .ci.yaml to version 8.20.0 (flutter/flutter#187133)
2026-05-28 737941+loic-sharma@users.noreply.github.com Improve SizedBox's docs (flutter/flutter#187208)
2026-05-28 bdero@google.com [Impeller] Support instanced rendering across all backends (flutter/flutter#186653)
2026-05-28 43054281+camsim99@users.noreply.github.com [Android] Reset system UI visibility flags when setting edge-to-edge mode (flutter/flutter#187207)
2026-05-28 engine-flutter-autoroll@skia.org Roll Skia from a38708fb7926 to 5493e4c144cd (7 revisions) (flutter/flutter#187241)
2026-05-28 30870216+gaaclarke@users.noreply.github.com Turned on impeller by default on macos (flutter/flutter#186546)
2026-05-28 mvincentong@gmail.com Clarify lazy scroll extent docs (flutter/flutter#186864)
2026-05-28 mdebbar@google.com [web] Fix WebParagraph locales test (flutter/flutter#186813)
2026-05-28 engine-flutter-autoroll@skia.org Roll Packages from 4b424d7 to 10cbdc5 (3 revisions) (flutter/flutter#187238)
2026-05-28 engine-flutter-autoroll@skia.org Roll Dart SDK from f3db7b7d9801 to 082191101fcc (8 revisions) (flutter/flutter#187235)
2026-05-28 engine-flutter-autoroll@skia.org Roll Skia from 32acea791248 to a38708fb7926 (1 revision) (flutter/flutter#187221)
2026-05-28 bdero@google.com [Flutter GPU] Add r32Float and remove Apple-only XR pixel formats (flutter/flutter#187069)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more platforms to MediaQueryData.alwaysUse24HourFormat's documentation

4 participants