Skip to content

Commit c8c8621

Browse files
authored
Clean up null safety messages (#120350)
1 parent 3fdd6ee commit c8c8621

File tree

7 files changed

+6
-35
lines changed

7 files changed

+6
-35
lines changed

packages/flutter_tools/lib/src/commands/build.dart

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,8 @@ abstract class BuildSubCommand extends FlutterCommand {
110110
/// This is similar to the run message in run_hot.dart
111111
@protected
112112
void displayNullSafetyMode(BuildInfo buildInfo) {
113-
_logger.printStatus('');
114-
if (buildInfo.nullSafetyMode == NullSafetyMode.sound) {
115-
_logger.printStatus(
116-
'💪 Building with sound null safety 💪',
117-
emphasis: true,
118-
);
119-
} else {
113+
if (buildInfo.nullSafetyMode != NullSafetyMode.sound) {
114+
_logger.printStatus('');
120115
_logger.printStatus(
121116
'Building without sound null safety ⚠️',
122117
emphasis: true,

packages/flutter_tools/lib/src/isolated/resident_web_runner.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,8 @@ class ResidentWebRunner extends ResidentRunner {
608608
..writeAsStringSync(websocketUri.toString());
609609
}
610610
_logger.printStatus('Debug service listening on $websocketUri');
611-
_logger.printStatus('');
612-
if (debuggingOptions.buildInfo.nullSafetyMode == NullSafetyMode.sound) {
613-
_logger.printStatus('💪 Running with sound null safety 💪', emphasis: true);
614-
} else {
611+
if (debuggingOptions.buildInfo.nullSafetyMode != NullSafetyMode.sound) {
612+
_logger.printStatus('');
615613
_logger.printStatus(
616614
'Running without sound null safety ⚠️',
617615
emphasis: true,

packages/flutter_tools/lib/src/run_hot.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,10 +1029,8 @@ class HotRunner extends ResidentRunner {
10291029
}
10301030
commandHelp.c.print();
10311031
commandHelp.q.print();
1032-
globals.printStatus('');
1033-
if (debuggingOptions.buildInfo.nullSafetyMode == NullSafetyMode.sound) {
1034-
globals.printStatus('💪 Running with sound null safety 💪', emphasis: true);
1035-
} else {
1032+
if (debuggingOptions.buildInfo.nullSafetyMode != NullSafetyMode.sound) {
1033+
globals.printStatus('');
10361034
globals.printStatus(
10371035
'Running without sound null safety ⚠️',
10381036
emphasis: true,

packages/flutter_tools/test/general.shard/commands/build_test.dart

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,11 @@ void main() {
105105
nullSafetyMode: NullSafetyMode.unsound,
106106
treeShakeIcons: false,
107107
);
108-
const BuildInfo sound = BuildInfo(
109-
BuildMode.debug,
110-
'',
111-
treeShakeIcons: false,
112-
);
113108

114109
final BufferLogger logger = BufferLogger.test();
115110
FakeBuildSubCommand(logger).test(unsound);
116111
expect(logger.statusText,
117112
contains('Building without sound null safety ⚠️'));
118-
119-
logger.clear();
120-
FakeBuildSubCommand(logger).test(sound);
121-
expect(logger.statusText,
122-
contains('💪 Building with sound null safety 💪'));
123113
});
124114

125115
testUsingContext('Include only supported sub commands', () {

packages/flutter_tools/test/general.shard/resident_runner_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,6 @@ flutter:
14921492
commandHelp.c,
14931493
commandHelp.q,
14941494
'',
1495-
'💪 Running with sound null safety 💪',
1496-
'',
14971495
'An Observatory debugger and profiler on FakeDevice is available at: null',
14981496
'',
14991497
].join('\n')
@@ -1523,8 +1521,6 @@ flutter:
15231521
commandHelp.c,
15241522
commandHelp.q,
15251523
'',
1526-
'💪 Running with sound null safety 💪',
1527-
'',
15281524
'An Observatory debugger and profiler on FakeDevice is available at: null',
15291525
'',
15301526
].join('\n')

packages/flutter_tools/test/general.shard/resident_web_runner_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,6 @@ void main() {
547547
'Waiting for connection from debug service on FakeDevice...\n'
548548
'Debug service listening on ws://127.0.0.1/abcd/\n'
549549
'\n'
550-
'💪 Running with sound null safety 💪\n'
551-
'\n'
552550
'first\n'
553551
'\n'
554552
'second\n'

packages/flutter_tools/test/integration.shard/overall_experience_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,6 @@ void main() {
591591
'c Clear the screen',
592592
'q Quit (terminate the application on the device).',
593593
'',
594-
contains('Running with sound null safety'),
595-
'',
596594
startsWith('An Observatory debugger and profiler on Flutter test device is available at: http://'),
597595
startsWith('The Flutter DevTools debugger and profiler on Flutter test device is available at: http://'),
598596
'',
@@ -620,8 +618,6 @@ void main() {
620618
'c Clear the screen',
621619
'q Quit (terminate the application on the device).',
622620
'',
623-
contains('Running with sound null safety'),
624-
'',
625621
startsWith('An Observatory debugger and profiler on Flutter test device is available at: http://'),
626622
startsWith('The Flutter DevTools debugger and profiler on Flutter test device is available at: http://'),
627623
'',

0 commit comments

Comments
 (0)