Add null safety note to flutter create (#74265)
This commit is contained in:
committed by
GitHub
parent
3fbe1a5904
commit
2f7804f41b
@@ -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.
|
||||
''');
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user