From fa05ce421df0dfda67d310d6b72c2e8af0f35a9a Mon Sep 17 00:00:00 2001 From: Brahim GUAALI <146823759+brahim-guaali@users.noreply.github.com> Date: Mon, 2 Feb 2026 16:07:17 +0400 Subject: [PATCH] Use null-aware spread in material/app.dart (#181586) ## Description Adopts null-aware spread syntax (`...?x`) in `material/app.dart`, replacing the verbose `if (x != null) ...x!` pattern. Fixes https://github.com/flutter/flutter/issues/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) --- packages/flutter/lib/src/material/app.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/material/app.dart b/packages/flutter/lib/src/material/app.dart index ee8cc8bbd1c..fd618e3c326 100644 --- a/packages/flutter/lib/src/material/app.dart +++ b/packages/flutter/lib/src/material/app.dart @@ -934,7 +934,7 @@ class _MaterialAppState extends State { // _MaterialLocalizationsDelegate. Iterable> get _localizationsDelegates { return >[ - if (widget.localizationsDelegates != null) ...widget.localizationsDelegates!, + ...?widget.localizationsDelegates, DefaultMaterialLocalizations.delegate, DefaultCupertinoLocalizations.delegate, ];