Skip to content

Use null-aware elements in cupertino/list_tile.dart#181243

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
brahim-guaali:fix/172188-null-aware-cupertino-list-tile
Feb 2, 2026
Merged

Use null-aware elements in cupertino/list_tile.dart#181243
auto-submit[bot] merged 2 commits into
flutter:masterfrom
brahim-guaali:fix/172188-null-aware-cupertino-list-tile

Conversation

@brahim-guaali

@brahim-guaali brahim-guaali commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Description

Adopts null-aware element syntax (?x) in cupertino/list_tile.dart, replacing 1 instance of the verbose if (x != null) x! pattern.

Contributes to #172188

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

talabat.com contributions Talabat Flutter PRs

@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels Jan 21, 2026

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

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.

Code Review

This pull request updates packages/flutter/lib/src/cupertino/list_tile.dart to use the null-aware element syntax (?). The change replaces a conditional if (widget.trailing != null) widget.trailing! with ?widget.trailing inside a list literal, which makes the code more concise and idiomatic. The change is correct and improves readability.

@dkwingsmt dkwingsmt requested a review from victorsanni January 28, 2026 19:18
@victorsanni

Copy link
Copy Markdown
Contributor

I see you have other PRs open for the same purpose, can you add them to this one to reduce the load on our CI? Thanks!

@brahim-guaali

brahim-guaali commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

@ksokolovskyi @AbdeMohlbi could you put this on auto submit when you get a chance?

@ksokolovskyi ksokolovskyi self-requested a review February 2, 2026 12:19

@ksokolovskyi ksokolovskyi left a comment

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.

Image

@ksokolovskyi ksokolovskyi added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 2, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Feb 2, 2026
Merged via the queue into flutter:master with commit 224d29a Feb 2, 2026
73 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Feb 2, 2026
flutter/flutter@9eafba4...c305f1f

2026-02-02 146823759+brahim-guaali@users.noreply.github.com Fix DecoratedSliver sample to avoid antialiasing gap (flutter/flutter#179848)
2026-02-02 koutaro.mo@gmail.com [Android] Add predictive back support for FlutterFragment and FlutterFragmentActivity (flutter/flutter#181124)
2026-02-02 engine-flutter-autoroll@skia.org Roll Packages from 510dd40 to 837dbbd (3 revisions) (flutter/flutter#181811)
2026-02-02 engine-flutter-autoroll@skia.org Roll Dart SDK from 434c5c6d1889 to 1aa8f2de7587 (1 revision) (flutter/flutter#181810)
2026-02-02 146823759+brahim-guaali@users.noreply.github.com Use null-aware elements in cupertino/list_tile.dart (flutter/flutter#181243)
2026-02-02 146823759+brahim-guaali@users.noreply.github.com Use null-aware elements in material/dialog.dart (flutter/flutter#181244)
2026-02-02 146823759+brahim-guaali@users.noreply.github.com Use null-aware spread in cupertino/app.dart (flutter/flutter#181585)
2026-02-02 146823759+brahim-guaali@users.noreply.github.com Use null-aware spread in material/app.dart (flutter/flutter#181586)
2026-02-02 engine-flutter-autoroll@skia.org Roll Dart SDK from 84abc8d58ec8 to 434c5c6d1889 (1 revision) (flutter/flutter#181800)
2026-02-02 engine-flutter-autoroll@skia.org Roll Skia from c14c5b243395 to 43fa79e1c51f (8 revisions) (flutter/flutter#181797)
2026-02-02 engine-flutter-autoroll@skia.org Roll Skia from 4ee9eb659ae0 to c14c5b243395 (1 revision) (flutter/flutter#181780)
2026-02-02 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from nI52U4LJMrBv8G1M9... to 1L4m9qCikk-JzrNWE... (flutter/flutter#181779)

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
LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Feb 6, 2026
## Description

Adopts null-aware element syntax (`?x`) in `cupertino/list_tile.dart`,
replacing 1 instance of the verbose `if (x != null) x!` pattern.

Contributes to flutter#172188

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md

[![talabat.com
contributions](https://img.shields.io/badge/talabat.com-contributions-FF5A00?style=flat&logo=flutter&logoColor=white)](https://www.talabat.com)
[![Talabat Flutter
PRs](https://img.shields.io/badge/Talabat_Flutter_PRs-10%20merged-97ca00?style=flat&logo=flutter&logoColor=white)](https://github.com/search?q=org%3Aflutter+talabat&type=pullrequests)

Co-authored-by: Kostia Sokolovskyi <sokolovskyi.konstantin@gmail.com>
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
## Description

Adopts null-aware element syntax (`?x`) in `cupertino/list_tile.dart`,
replacing 1 instance of the verbose `if (x != null) x!` pattern.

Contributes to flutter#172188

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md

[![talabat.com
contributions](https://img.shields.io/badge/talabat.com-contributions-FF5A00?style=flat&logo=flutter&logoColor=white)](https://www.talabat.com)
[![Talabat Flutter
PRs](https://img.shields.io/badge/Talabat_Flutter_PRs-10%20merged-97ca00?style=flat&logo=flutter&logoColor=white)](https://github.com/search?q=org%3Aflutter+talabat&type=pullrequests)

Co-authored-by: Kostia Sokolovskyi <sokolovskyi.konstantin@gmail.com>
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
## Description

Adopts null-aware element syntax (`?x`) in `cupertino/list_tile.dart`,
replacing 1 instance of the verbose `if (x != null) x!` pattern.

Contributes to flutter#172188

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md

[![talabat.com
contributions](https://img.shields.io/badge/talabat.com-contributions-FF5A00?style=flat&logo=flutter&logoColor=white)](https://www.talabat.com)
[![Talabat Flutter
PRs](https://img.shields.io/badge/Talabat_Flutter_PRs-10%20merged-97ca00?style=flat&logo=flutter&logoColor=white)](https://github.com/search?q=org%3Aflutter+talabat&type=pullrequests)

Co-authored-by: Kostia Sokolovskyi <sokolovskyi.konstantin@gmail.com>
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…r#10956)

flutter/flutter@9eafba4...c305f1f

2026-02-02 146823759+brahim-guaali@users.noreply.github.com Fix DecoratedSliver sample to avoid antialiasing gap (flutter/flutter#179848)
2026-02-02 koutaro.mo@gmail.com [Android] Add predictive back support for FlutterFragment and FlutterFragmentActivity (flutter/flutter#181124)
2026-02-02 engine-flutter-autoroll@skia.org Roll Packages from 510dd40 to 837dbbd (3 revisions) (flutter/flutter#181811)
2026-02-02 engine-flutter-autoroll@skia.org Roll Dart SDK from 434c5c6d1889 to 1aa8f2de7587 (1 revision) (flutter/flutter#181810)
2026-02-02 146823759+brahim-guaali@users.noreply.github.com Use null-aware elements in cupertino/list_tile.dart (flutter/flutter#181243)
2026-02-02 146823759+brahim-guaali@users.noreply.github.com Use null-aware elements in material/dialog.dart (flutter/flutter#181244)
2026-02-02 146823759+brahim-guaali@users.noreply.github.com Use null-aware spread in cupertino/app.dart (flutter/flutter#181585)
2026-02-02 146823759+brahim-guaali@users.noreply.github.com Use null-aware spread in material/app.dart (flutter/flutter#181586)
2026-02-02 engine-flutter-autoroll@skia.org Roll Dart SDK from 84abc8d58ec8 to 434c5c6d1889 (1 revision) (flutter/flutter#181800)
2026-02-02 engine-flutter-autoroll@skia.org Roll Skia from c14c5b243395 to 43fa79e1c51f (8 revisions) (flutter/flutter#181797)
2026-02-02 engine-flutter-autoroll@skia.org Roll Skia from 4ee9eb659ae0 to c14c5b243395 (1 revision) (flutter/flutter#181780)
2026-02-02 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from nI52U4LJMrBv8G1M9... to 1L4m9qCikk-JzrNWE... (flutter/flutter#181779)

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: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants