Skip to content

[flutter_tools] display message for current null safety mode#70718

Merged
jonahwilliams merged 8 commits intoflutter:masterfrom
jonahwilliams:null_safe_mode
Nov 20, 2020
Merged

[flutter_tools] display message for current null safety mode#70718
jonahwilliams merged 8 commits intoflutter:masterfrom
jonahwilliams:null_safe_mode

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Nov 17, 2020

Description

Let the user know what null safety mode they are running in.

@devoncarew is there a way we can surface this in the IDEs?

sound mode:

jonahwilliams-macbookpro2:hello_world jonahwilliams$ flutter run -d chrome --no-sound-null-safety
Building flutter tool...
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...              6.8s
Debug service listening on ws://127.0.0.1:51904/2HLOsFqHyjg=/ws

🔨 Running with unsound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

🔥  To hot restart changes while running, press "r" or "R".
For a more detailed help message, press "h". To quit, press "q".

Application finished.
jonahwilliams-macbookpro2:hello_world jonahwilliams$ flutter run -d chrome
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...              8.2s
Debug service listening on ws://127.0.0.1:52002/qLyOLUxjDBY=/ws

💪 Running with sound null safety

🔥  To hot restart changes while running, press "r" or "R".
For a more detailed help message, press "h". To quit, press "q".

I tried to use non-scary emojis for unsound mode

@google-cla google-cla bot added the cla: yes label Nov 17, 2020
@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Nov 17, 2020
@jonahwilliams jonahwilliams added the a: null-safety Support for Dart's null safety feature label Nov 17, 2020
@devoncarew
Copy link
Contributor

@devoncarew is there a way we can surface this in the IDEs?

I think the best place would be to show it as part of the 2-3 lines that show when an app launches.

Launching lib/main.dart on iPhone 11 in debug mode...
Running Xcode build...
Xcode build done.                                           20.5s
Waiting for iPhone 11 to report its views...
Debug service listening on ws://127.0.0.1:51331/_JrZ-UyWtvA=/ws
Syncing files to device iPhone 11...

Having a line there that said Running with sound null safety 💪 would make sense.

For the other line - 🔨 Running without sound null safety 🔨 - you might consider dropping the emojis, and adding a link where the user could learn more about upgrading:

Running without sound null safety (see dart.dev/go/unsound-null-safety).

(as an aside, I'm not sure we need to print the 'Waiting for iPhone 11 to report its views...' line, in the interests of brevity at startup)

@jonahwilliams
Copy link
Contributor Author

(as an aside, I'm not sure we need to print the 'Waiting for iPhone 11 to report its views...' line, in the interests of brevity at startup)

Yeah, I think we should leave that out unless we're waiting more than a few seconds.

I was worried that it would be lost if we printed it earlier, and without the emojis It didn't really stand out

@jonahwilliams jonahwilliams marked this pull request as ready for review November 20, 2020 01:21
Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

lgtm

Emoji bikeshed:
Agree with dropping the hammer emoji for the unsound case. Maybe also put the bicep emoji both before and after the 'sound' message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: null-safety Support for Dart's null safety feature tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants