Add --empty to the flutter create command (#113873)

This commit is contained in:
Greg Spencer
2022-10-24 14:20:03 -07:00
committed by GitHub
parent 3c2f500b1b
commit 5259e1bc6d
7 changed files with 98 additions and 3 deletions

View File

@@ -1944,6 +1944,28 @@ void main() {
},
);
testUsingContext('can create an empty application project', () async {
await _createAndAnalyzeProject(
projectDir,
<String>['--no-pub', '--empty'],
<String>[
'lib/main.dart',
'flutter_project.iml',
'android/app/src/main/AndroidManifest.xml',
'ios/Flutter/AppFrameworkInfo.plist',
],
unexpectedPaths: <String>['test'],
);
expect(projectDir.childDirectory('lib').childFile('main.dart').readAsStringSync(),
contains("Text('Hello World!')"));
expect(projectDir.childDirectory('lib').childFile('main.dart').readAsStringSync(),
isNot(contains('int _counter')));
expect(projectDir.childFile('analysis_options.yaml').readAsStringSync(),
isNot(contains('#')));
expect(projectDir.childFile('README.md').readAsStringSync(),
isNot(contains('Getting Started')));
});
testUsingContext('can create a sample-based project', () async {
await _createAndAnalyzeProject(
projectDir,