Add null safety note to flutter create (#74265)

This commit is contained in:
Michael Goderbauer
2021-01-19 14:52:43 -08:00
committed by GitHub
parent 3fbe1a5904
commit 2f7804f41b
2 changed files with 24 additions and 0 deletions

View File

@@ -311,6 +311,11 @@ In order to run your $application, type:
\$ cd $relativeAppPath
\$ flutter run
To enable null safety, type:
\$ cd $relativeAppPath
\$ dart migrate --apply-changes
Your $application code is in $relativeAppMain.
''');
}

View File

@@ -2335,6 +2335,25 @@ void main() {
FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false),
Logger: () => logger,
});
testUsingContext('flutter create prints note about null safety', () async {
await _createProject(
projectDir,
<String>[],
<String>[],
);
expect(logger.statusText, contains('dart migrate --apply-changes'));
}, overrides: <Type, Generator>{
Pub: () => Pub(
fileSystem: globals.fs,
logger: globals.logger,
processManager: globals.processManager,
usage: globals.flutterUsage,
botDetector: globals.botDetector,
platform: globals.platform,
),
Logger: () => logger,
});
}
Future<void> _createProject(