Enable null safety by default in templates (#78619)

This commit is contained in:
Michael Thomsen
2021-03-30 10:16:05 +02:00
committed by GitHub
parent e93590474d
commit 2cdd51900c
13 changed files with 25 additions and 151 deletions

View File

@@ -242,8 +242,8 @@ class CreateCommand extends CreateBase {
macos: featureFlags.isMacOSEnabled && platforms.contains('macos'),
windows: featureFlags.isWindowsEnabled && platforms.contains('windows'),
windowsUwp: featureFlags.isWindowsUwpEnabled && platforms.contains('winuwp'),
// Enable null-safety for sample code, which is - unlike our regular templates - already migrated.
dartSdkVersionBounds: sampleCode != null ? '">=2.12.0-0 <3.0.0"' : '">=2.7.0 <3.0.0"'
// Enable null safety everywhere.
dartSdkVersionBounds: '">=2.12.0 <3.0.0"'
);
final String relativeDirPath = globals.fs.path.relative(projectDirPath);
@@ -325,11 +325,6 @@ 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.
''');
// Show warning if any selected platform is not enabled