Skip to content

Add titleAlignment to CheckboxListTile and RadioListTile #168666

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

Conversation

ValentinVignal
Copy link
Contributor

Fixes #168596 (comment)

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels May 12, 2025
@victorsanni victorsanni self-requested a review May 12, 2025 18:09
@ayyoub-coder
Copy link
Contributor

Thanks @ValentinVignal for driving this feature! 🚀

cc @QuncCccccc
Quick suggestion to keep this simple and consistent:

  1. Grab alignment from the theme

    final ListTileTitleAlignment? listTileTitleAlignment = ListTileTheme.of(context).titleAlignment;
    // …
    titleAlignment: listTileTitleAlignment,
  2. Wrap your tile in a theme merge

    ListTileTheme.merge(
     titleAlignment: ListTileTitleAlignment.center, // or whatever you need
     child: CheckboxListTile( /* no titleAlignment here */)
     );

Why this helps

  • Centralized logic in ListTileThemeData (same as colors, padding, density)
  • No duplicate params in CheckboxListTile/RadioListTile/SwitchListTile
  • Flexible overrides—global via ThemeData.listTileTheme or local via ListTileTheme.merge

Copy link
Contributor

@MitchellGoodwin MitchellGoodwin left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@victorsanni victorsanni left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the PR.

@ValentinVignal
Copy link
Contributor Author

@MitchellGoodwin @victorsanni I see google testing failed. I don't have access to it, right?
Can I ask for your help to know what went wrong?

@victorsanni
Copy link
Contributor

@MitchellGoodwin @victorsanni I see google testing failed. I don't have access to it, right? Can I ask for your help to know what went wrong?

Rerunning, probably a flake.

@ValentinVignal ValentinVignal added the autosubmit Merge PR when tree becomes green via auto submit App label May 14, 2025
@auto-submit auto-submit bot added this pull request to the merge queue May 14, 2025
Merged via the queue into flutter:master with commit 4d037cf May 14, 2025
76 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request May 14, 2025
flutter/flutter@336a7ec...0b9f928

2025-05-14 robert.ancell@canonical.com Fix Linux Impeller support broken by incorrect deletion of stencil buffer. (flutter/flutter#168668)
2025-05-14 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 6J81agNhuK4q255Jj... to fSvuEJgRmHxnewRJr... (flutter/flutter#168794)
2025-05-14 matanlurey@users.noreply.github.com Run `{Platform} flutter_packaging` builders on release candidates. (flutter/flutter#168762)
2025-05-14 matanlurey@users.noreply.github.com Remove `docs_deploy_beta`, fix `docs_publish`, add comments. (flutter/flutter#168754)
2025-05-14 32538273+ValentinVignal@users.noreply.github.com Add `titleAlignment` to `CheckboxListTile` and `RadioListTile`  (flutter/flutter#168666)
2025-05-14 32538273+ValentinVignal@users.noreply.github.com Remove deprecated todo about caching (flutter/flutter#168534)
2025-05-13 mohellebiabdessalem@gmail.com Replace hardcoded host and app level build.gradle paths with `AndroidProject`-level getters in `gradle_errors.dart` (flutter/flutter#167949)
2025-05-13 75997342+dogaozyagci@users.noreply.github.com Improve documentation for KeyedSubtree constructor (flutter/flutter#167198)
2025-05-13 31859944+LongCatIsLooong@users.noreply.github.com Wire up the system text scaler from `PlatformDispatcher` (flutter/flutter#159999)
2025-05-13 engine-flutter-autoroll@skia.org Roll Dart SDK from 645d04a7a964 to b3520981e0f0 (3 revisions) (flutter/flutter#168721)
2025-05-13 jhy03261997@gmail.com [a11y] Semanctis flag refactor step 3: framework part (flutter/flutter#167771)
2025-05-13 matanlurey@users.noreply.github.com Remove/replace the `team` label with `c: contributor-productivity`. (flutter/flutter#168702)
2025-05-13 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Clip search artifacts in CupertinoSliverNavigationBar searchable-to-searchable transitions (#168510)" (flutter/flutter#168775)
2025-05-13 muhatashim@google.com Use live region in error text input decorator for Android (flutter/flutter#165531)
2025-05-13 kevmoo@users.noreply.github.com [tool] Fix deprecated API calls within tool (flutter/flutter#168200)
2025-05-13 victorsanniay@gmail.com Clip search artifacts in CupertinoSliverNavigationBar searchable-to-searchable transitions (flutter/flutter#168510)
2025-05-13 47866232+chunhtai@users.noreply.github.com Fixes hero not shown when remove pages without animation (flutter/flutter#168617)
2025-05-13 rmolivares@renzo-olivares.dev [iOS] Do not hide selection handles when platform hides system context menu (flutter/flutter#168678)
2025-05-13 jessy.yameogo@gmail.com Updated execution path to silently include --start-paused and updated tests (flutter/flutter#168400)
2025-05-13 engine-flutter-autoroll@skia.org Roll Packages from 6a28ad9 to 2e166de (2 revisions) (flutter/flutter#168736)
2025-05-13 sokolovskyi.konstantin@gmail.com [web] Fix multiline input selection in Chrome. (flutter/flutter#168217)
2025-05-13 15619084+vashworth@users.noreply.github.com Call xcode_backend.dart from macos_assemble.sh (flutter/flutter#168108)

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 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
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
…r#9251)

flutter/flutter@336a7ec...0b9f928

2025-05-14 robert.ancell@canonical.com Fix Linux Impeller support broken by incorrect deletion of stencil buffer. (flutter/flutter#168668)
2025-05-14 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 6J81agNhuK4q255Jj... to fSvuEJgRmHxnewRJr... (flutter/flutter#168794)
2025-05-14 matanlurey@users.noreply.github.com Run `{Platform} flutter_packaging` builders on release candidates. (flutter/flutter#168762)
2025-05-14 matanlurey@users.noreply.github.com Remove `docs_deploy_beta`, fix `docs_publish`, add comments. (flutter/flutter#168754)
2025-05-14 32538273+ValentinVignal@users.noreply.github.com Add `titleAlignment` to `CheckboxListTile` and `RadioListTile`  (flutter/flutter#168666)
2025-05-14 32538273+ValentinVignal@users.noreply.github.com Remove deprecated todo about caching (flutter/flutter#168534)
2025-05-13 mohellebiabdessalem@gmail.com Replace hardcoded host and app level build.gradle paths with `AndroidProject`-level getters in `gradle_errors.dart` (flutter/flutter#167949)
2025-05-13 75997342+dogaozyagci@users.noreply.github.com Improve documentation for KeyedSubtree constructor (flutter/flutter#167198)
2025-05-13 31859944+LongCatIsLooong@users.noreply.github.com Wire up the system text scaler from `PlatformDispatcher` (flutter/flutter#159999)
2025-05-13 engine-flutter-autoroll@skia.org Roll Dart SDK from 645d04a7a964 to b3520981e0f0 (3 revisions) (flutter/flutter#168721)
2025-05-13 jhy03261997@gmail.com [a11y] Semanctis flag refactor step 3: framework part (flutter/flutter#167771)
2025-05-13 matanlurey@users.noreply.github.com Remove/replace the `team` label with `c: contributor-productivity`. (flutter/flutter#168702)
2025-05-13 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Clip search artifacts in CupertinoSliverNavigationBar searchable-to-searchable transitions (#168510)" (flutter/flutter#168775)
2025-05-13 muhatashim@google.com Use live region in error text input decorator for Android (flutter/flutter#165531)
2025-05-13 kevmoo@users.noreply.github.com [tool] Fix deprecated API calls within tool (flutter/flutter#168200)
2025-05-13 victorsanniay@gmail.com Clip search artifacts in CupertinoSliverNavigationBar searchable-to-searchable transitions (flutter/flutter#168510)
2025-05-13 47866232+chunhtai@users.noreply.github.com Fixes hero not shown when remove pages without animation (flutter/flutter#168617)
2025-05-13 rmolivares@renzo-olivares.dev [iOS] Do not hide selection handles when platform hides system context menu (flutter/flutter#168678)
2025-05-13 jessy.yameogo@gmail.com Updated execution path to silently include --start-paused and updated tests (flutter/flutter#168400)
2025-05-13 engine-flutter-autoroll@skia.org Roll Packages from 6a28ad9 to 2e166de (2 revisions) (flutter/flutter#168736)
2025-05-13 sokolovskyi.konstantin@gmail.com [web] Fix multiline input selection in Chrome. (flutter/flutter#168217)
2025-05-13 15619084+vashworth@users.noreply.github.com Call xcode_backend.dart from macos_assemble.sh (flutter/flutter#168108)

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 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
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to change the alignment in RadioListTile and CheckboxListTile
4 participants