Clean up null safety messages (#120350)

This commit is contained in:
Michael Thomsen 2023-02-09 19:40:32 +01:00 committed by GitHub
parent 3fdd6ee46f
commit c8c8621416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 6 additions and 35 deletions

View File

@ -110,13 +110,8 @@ abstract class BuildSubCommand extends FlutterCommand {
/// This is similar to the run message in run_hot.dart
@protected
void displayNullSafetyMode(BuildInfo buildInfo) {
_logger.printStatus('');
if (buildInfo.nullSafetyMode == NullSafetyMode.sound) {
_logger.printStatus(
'💪 Building with sound null safety 💪',
emphasis: true,
);
} else {
if (buildInfo.nullSafetyMode != NullSafetyMode.sound) {
_logger.printStatus('');
_logger.printStatus(
'Building without sound null safety ⚠️',
emphasis: true,

View File

@ -608,10 +608,8 @@ class ResidentWebRunner extends ResidentRunner {
..writeAsStringSync(websocketUri.toString());
}
_logger.printStatus('Debug service listening on $websocketUri');
_logger.printStatus('');
if (debuggingOptions.buildInfo.nullSafetyMode == NullSafetyMode.sound) {
_logger.printStatus('💪 Running with sound null safety 💪', emphasis: true);
} else {
if (debuggingOptions.buildInfo.nullSafetyMode != NullSafetyMode.sound) {
_logger.printStatus('');
_logger.printStatus(
'Running without sound null safety ⚠️',
emphasis: true,

View File

@ -1029,10 +1029,8 @@ class HotRunner extends ResidentRunner {
}
commandHelp.c.print();
commandHelp.q.print();
globals.printStatus('');
if (debuggingOptions.buildInfo.nullSafetyMode == NullSafetyMode.sound) {
globals.printStatus('💪 Running with sound null safety 💪', emphasis: true);
} else {
if (debuggingOptions.buildInfo.nullSafetyMode != NullSafetyMode.sound) {
globals.printStatus('');
globals.printStatus(
'Running without sound null safety ⚠️',
emphasis: true,

View File

@ -105,21 +105,11 @@ void main() {
nullSafetyMode: NullSafetyMode.unsound,
treeShakeIcons: false,
);
const BuildInfo sound = BuildInfo(
BuildMode.debug,
'',
treeShakeIcons: false,
);
final BufferLogger logger = BufferLogger.test();
FakeBuildSubCommand(logger).test(unsound);
expect(logger.statusText,
contains('Building without sound null safety ⚠️'));
logger.clear();
FakeBuildSubCommand(logger).test(sound);
expect(logger.statusText,
contains('💪 Building with sound null safety 💪'));
});
testUsingContext('Include only supported sub commands', () {

View File

@ -1492,8 +1492,6 @@ flutter:
commandHelp.c,
commandHelp.q,
'',
'💪 Running with sound null safety 💪',
'',
'An Observatory debugger and profiler on FakeDevice is available at: null',
'',
].join('\n')
@ -1523,8 +1521,6 @@ flutter:
commandHelp.c,
commandHelp.q,
'',
'💪 Running with sound null safety 💪',
'',
'An Observatory debugger and profiler on FakeDevice is available at: null',
'',
].join('\n')

View File

@ -547,8 +547,6 @@ void main() {
'Waiting for connection from debug service on FakeDevice...\n'
'Debug service listening on ws://127.0.0.1/abcd/\n'
'\n'
'💪 Running with sound null safety 💪\n'
'\n'
'first\n'
'\n'
'second\n'

View File

@ -591,8 +591,6 @@ void main() {
'c Clear the screen',
'q Quit (terminate the application on the device).',
'',
contains('Running with sound null safety'),
'',
startsWith('An Observatory debugger and profiler on Flutter test device is available at: http://'),
startsWith('The Flutter DevTools debugger and profiler on Flutter test device is available at: http://'),
'',
@ -620,8 +618,6 @@ void main() {
'c Clear the screen',
'q Quit (terminate the application on the device).',
'',
contains('Running with sound null safety'),
'',
startsWith('An Observatory debugger and profiler on Flutter test device is available at: http://'),
startsWith('The Flutter DevTools debugger and profiler on Flutter test device is available at: http://'),
'',