Skip to content

Conversation

@goderbauer
Copy link
Member

Part of #118837.

Dart 3 drops support for non-null safe code, so we can finally turn on the unnecessary_null_comparison lint and remove the unnecessary checks it flags.

The first commit contains fixes automatically applied by running dart fix --apply. The second commit contains some manual fixes on top of that.

@flutter-dashboard flutter-dashboard bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Jan 20, 2023
@christopherfujino
Copy link
Contributor

oops, forgot to finish reviewing, looking now

if ((debugPort == null && debugUri == null) || isNetworkDevice) {
if (device is FuchsiaDevice) {
final String module = stringArgDeprecated('module')!;
final String? module = stringArgDeprecated('module');
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

}

await portForwarder.unforward(forwardedPort);
await portForwarder.unforward(forwardedPort!);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move this to an else block, lest we hit a _CastError with the bang operator?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

while (path != null) {
buf.write(path.to);
path = path.from!;
path = path.from;
Copy link
Contributor

Choose a reason for hiding this comment

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

LOL, I'm guessing if you tried to run this before this change you'd get a _CastError, good catch!

Copy link
Contributor

Choose a reason for hiding this comment

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

(this is a maintainer tool for diagnosing version solving problems, so not often run)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hehe. I was very curious about how this piece of code was running before...

Copy link
Contributor

@christopherfujino christopherfujino 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 this huge cleanup, including some bug fixes!

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 23, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 23, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Jan 23, 2023

auto label is removed for flutter/flutter, pr: 118857, due to - The status or check suite Linux framework_tests_slow has failed. Please fix the issues identified (or deflake) before re-applying this label.

  • The status or check suite Linux analyze has failed. Please fix the issues identified (or deflake) before re-applying this label.

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 23, 2023
@auto-submit auto-submit bot merged commit 38630b6 into flutter:master Jan 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 24, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jan 24, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 24, 2023
* 3bf7960 [web] Fix paths fetched by flutter.js (flutter/flutter#118684)

* e71e8da 76998e529 Roll Fuchsia Linux SDK from f613tOkDB282hW2tA... to GLRbnjiO5SbZKX-Us... (flutter/engine#39067) (flutter/flutter#119009)

* 71a4256 Revert "[Re-land] Button padding m3 (#118640)" (flutter/flutter#118962)

* 90ffb1c 94fc0728f Roll Dart SDK from c52810968747 to 107a1280a61f (1 revision) (flutter/engine#39069) (flutter/flutter#119010)

* 224e6aa Remove unnecessary null checks in flutter/gestures (flutter/flutter#118926)

* 6cd4945 Remove unnecessary null checks in flutter_web_plugins (flutter/flutter#118862)

* a63e19b Remove unnecessary null checks in flutter_localizations (flutter/flutter#118863)

* 19dfde6 Remove unnecessary null checks in `flutter/{foundation,services,physics}` (flutter/flutter#118910)

* 392dffe Update the Linux Android defines test to use dimensions when selecting a build bot (flutter/flutter#118930)

* 5e50ed9 Test Utf8FromUtf16 (flutter/flutter#118647)

* edb571e Update README.md (flutter/flutter#118803)

* 38630b6 Remove unnecessary null checks in `flutter_tool` (flutter/flutter#118857)

* 332aed9 Revert "Update the Linux Android defines test to use dimensions when selecting a build bot (#118930)" (flutter/flutter#119023)

* 84071aa Add todo for linux defines test. (flutter/flutter#119035)

* e8b7f4b [examples] Fix typo in `refresh_indicator` example (flutter/flutter#119000)

* df44208 Remove ThemeData.buttonColor references (flutter/flutter#118658)

* 6548616 Remove animated_complex_opacity_perf_macos__e2e_summary bringup (flutter/flutter#118916)

* 59767e5 Remove unnecessary null checks in `flutter/material` (flutter/flutter#119022)

* 1906ce5 7d3233d26 [web] Build multiple CanvasKit variants (using toolchain_args) (flutter/engine#38448) (flutter/flutter#119021)

* 720bea0 Remove unnecessary null checks in `flutter/widgets` (flutter/flutter#119028)

* 0de8bef Remove unnecessary null checks in flutter/cupertino (flutter/flutter#119020)

* 2e8dd9d Run integration_ui_test_test_macos in prod (flutter/flutter#118919)

* 64b4c69 roll pub deps and remove archive, crypto, typed_data from allow-list (flutter/flutter#119018)

* c35efda Remove superfluous words. (flutter/flutter#119008)
auto-submit bot pushed a commit to flutter/plugins that referenced this pull request Jan 24, 2023
* 3bf7960 [web] Fix paths fetched by flutter.js (flutter/flutter#118684)

* e71e8da 76998e529 Roll Fuchsia Linux SDK from f613tOkDB282hW2tA... to GLRbnjiO5SbZKX-Us... (flutter/engine#39067) (flutter/flutter#119009)

* 71a4256 Revert "[Re-land] Button padding m3 (#118640)" (flutter/flutter#118962)

* 90ffb1c 94fc0728f Roll Dart SDK from c52810968747 to 107a1280a61f (1 revision) (flutter/engine#39069) (flutter/flutter#119010)

* 224e6aa Remove unnecessary null checks in flutter/gestures (flutter/flutter#118926)

* 6cd4945 Remove unnecessary null checks in flutter_web_plugins (flutter/flutter#118862)

* a63e19b Remove unnecessary null checks in flutter_localizations (flutter/flutter#118863)

* 19dfde6 Remove unnecessary null checks in `flutter/{foundation,services,physics}` (flutter/flutter#118910)

* 392dffe Update the Linux Android defines test to use dimensions when selecting a build bot (flutter/flutter#118930)

* 5e50ed9 Test Utf8FromUtf16 (flutter/flutter#118647)

* edb571e Update README.md (flutter/flutter#118803)

* 38630b6 Remove unnecessary null checks in `flutter_tool` (flutter/flutter#118857)

* 332aed9 Revert "Update the Linux Android defines test to use dimensions when selecting a build bot (#118930)" (flutter/flutter#119023)

* 84071aa Add todo for linux defines test. (flutter/flutter#119035)

* e8b7f4b [examples] Fix typo in `refresh_indicator` example (flutter/flutter#119000)

* df44208 Remove ThemeData.buttonColor references (flutter/flutter#118658)

* 6548616 Remove animated_complex_opacity_perf_macos__e2e_summary bringup (flutter/flutter#118916)

* 59767e5 Remove unnecessary null checks in `flutter/material` (flutter/flutter#119022)

* 1906ce5 7d3233d26 [web] Build multiple CanvasKit variants (using toolchain_args) (flutter/engine#38448) (flutter/flutter#119021)

* 720bea0 Remove unnecessary null checks in `flutter/widgets` (flutter/flutter#119028)

* 0de8bef Remove unnecessary null checks in flutter/cupertino (flutter/flutter#119020)

* 2e8dd9d Run integration_ui_test_test_macos in prod (flutter/flutter#118919)

* 64b4c69 roll pub deps and remove archive, crypto, typed_data from allow-list (flutter/flutter#119018)

* c35efda Remove superfluous words. (flutter/flutter#119008)
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
* 3bf7960 [web] Fix paths fetched by flutter.js (flutter/flutter#118684)

* e71e8da 76998e529 Roll Fuchsia Linux SDK from f613tOkDB282hW2tA... to GLRbnjiO5SbZKX-Us... (flutter/engine#39067) (flutter/flutter#119009)

* 71a4256 Revert "[Re-land] Button padding m3 (#118640)" (flutter/flutter#118962)

* 90ffb1c 94fc0728f Roll Dart SDK from c52810968747 to 107a1280a61f (1 revision) (flutter/engine#39069) (flutter/flutter#119010)

* 224e6aa Remove unnecessary null checks in flutter/gestures (flutter/flutter#118926)

* 6cd4945 Remove unnecessary null checks in flutter_web_plugins (flutter/flutter#118862)

* a63e19b Remove unnecessary null checks in flutter_localizations (flutter/flutter#118863)

* 19dfde6 Remove unnecessary null checks in `flutter/{foundation,services,physics}` (flutter/flutter#118910)

* 392dffe Update the Linux Android defines test to use dimensions when selecting a build bot (flutter/flutter#118930)

* 5e50ed9 Test Utf8FromUtf16 (flutter/flutter#118647)

* edb571e Update README.md (flutter/flutter#118803)

* 38630b6 Remove unnecessary null checks in `flutter_tool` (flutter/flutter#118857)

* 332aed9 Revert "Update the Linux Android defines test to use dimensions when selecting a build bot (#118930)" (flutter/flutter#119023)

* 84071aa Add todo for linux defines test. (flutter/flutter#119035)

* e8b7f4b [examples] Fix typo in `refresh_indicator` example (flutter/flutter#119000)

* df44208 Remove ThemeData.buttonColor references (flutter/flutter#118658)

* 6548616 Remove animated_complex_opacity_perf_macos__e2e_summary bringup (flutter/flutter#118916)

* 59767e5 Remove unnecessary null checks in `flutter/material` (flutter/flutter#119022)

* 1906ce5 7d3233d26 [web] Build multiple CanvasKit variants (using toolchain_args) (flutter/engine#38448) (flutter/flutter#119021)

* 720bea0 Remove unnecessary null checks in `flutter/widgets` (flutter/flutter#119028)

* 0de8bef Remove unnecessary null checks in flutter/cupertino (flutter/flutter#119020)

* 2e8dd9d Run integration_ui_test_test_macos in prod (flutter/flutter#118919)

* 64b4c69 roll pub deps and remove archive, crypto, typed_data from allow-list (flutter/flutter#119018)

* c35efda Remove superfluous words. (flutter/flutter#119008)
@goderbauer goderbauer deleted the nullCheckTool branch March 3, 2023 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants