Rename 'application' back to 'module', and make 'app' the default again for templates. (#22888)

We decided that redefining the default for templates was premature. We're going to go back to having "module" in experimental land again, and we'll try again when we have the feature set fully baked.

This keeps the writing of the .metadata files, and writing the template type to them, because that was a good improvement, and there are still a bunch of added tests that improve our coverage.
diff --git a/packages/flutter_tools/test/commands/packages_test.dart b/packages/flutter_tools/test/commands/packages_test.dart
index c8cad27..051bd39 100644
--- a/packages/flutter_tools/test/commands/packages_test.dart
+++ b/packages/flutter_tools/test/commands/packages_test.dart
@@ -45,8 +45,8 @@
       tryToDelete(tempDir);
     });
 
-    Future<String> createProjectWithPlugin(String plugin) async {
-      final String projectPath = await createProject(tempDir);
+    Future<String> createProjectWithPlugin(String plugin, {List<String> arguments}) async {
+      final String projectPath = await createProject(tempDir, arguments: arguments);
       final File pubspec = fs.file(fs.path.join(projectPath, 'pubspec.yaml'));
       String content = await pubspec.readAsString();
       content = content.replaceFirst(
@@ -114,7 +114,7 @@
       'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java',
     ];
 
-    const List<String> applicationPluginRegistrants = <String>[
+    const List<String> modulePluginRegistrants = <String>[
       '.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedPluginRegistrant.h',
       '.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedPluginRegistrant.m',
       '.android/Flutter/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java',
@@ -125,7 +125,7 @@
       'ios/Podfile',
     ];
 
-    const List<String> applicationPluginWitnesses = <String>[
+    const List<String> modulePluginWitnesses = <String>[
       '.flutter-plugins',
       '.ios/Podfile',
     ];
@@ -135,7 +135,7 @@
       'ios/Flutter/Release.xcconfig': '#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"',
     };
 
-    const Map<String, String> applicationPluginContentWitnesses = <String, String>{
+    const Map<String, String> modulePluginContentWitnesses = <String, String>{
       '.ios/Config/Debug.xcconfig': '#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"',
       '.ios/Config/Release.xcconfig': '#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"',
     };
@@ -147,13 +147,13 @@
     }
 
     void expectZeroPluginsInjected(String projectPath) {
-      for (final String registrant in applicationPluginRegistrants) {
+      for (final String registrant in modulePluginRegistrants) {
         expectExists(projectPath, registrant);
       }
       for (final String witness in pluginWitnesses) {
         expectNotExists(projectPath, witness);
       }
-      applicationPluginContentWitnesses.forEach((String witness, String content) {
+      modulePluginContentWitnesses.forEach((String witness, String content) {
         expectNotContains(projectPath, witness, content);
       });
     }
@@ -170,14 +170,14 @@
       });
     }
 
-    void expectApplicationPluginInjected(String projectPath) {
-      for (final String registrant in applicationPluginRegistrants) {
+    void expectModulePluginInjected(String projectPath) {
+      for (final String registrant in modulePluginRegistrants) {
         expectExists(projectPath, registrant);
       }
-      for (final String witness in applicationPluginWitnesses) {
+      for (final String witness in modulePluginWitnesses) {
         expectExists(projectPath, witness);
       }
-      applicationPluginContentWitnesses.forEach((String witness, String content) {
+      modulePluginContentWitnesses.forEach((String witness, String content) {
         expectContains(projectPath, witness, content);
       });
     }
@@ -185,7 +185,7 @@
     void removeGeneratedFiles(String projectPath) {
       final Iterable<String> allFiles = <List<String>>[
         pubOutput,
-        applicationPluginRegistrants,
+        modulePluginRegistrants,
         pluginWitnesses,
       ].expand<String>((List<String> list) => list);
       for (String path in allFiles) {
@@ -196,7 +196,8 @@
     }
 
     testUsingContext('get fetches packages', () async {
-      final String projectPath = await createProject(tempDir);
+      final String projectPath = await createProject(tempDir,
+        arguments: <String>['--no-pub', '--template=module']);
       removeGeneratedFiles(projectPath);
 
       await runCommandIn(projectPath, 'get');
@@ -206,7 +207,8 @@
     }, timeout: allowForRemotePubInvocation);
 
     testUsingContext('get --offline fetches packages', () async {
-      final String projectPath = await createProject(tempDir);
+      final String projectPath = await createProject(tempDir,
+        arguments: <String>['--no-pub', '--template=module']);
       removeGeneratedFiles(projectPath);
 
       await runCommandIn(projectPath, 'get', args: <String>['--offline']);
@@ -216,7 +218,8 @@
     }, timeout: allowForCreateFlutterProject);
 
     testUsingContext('upgrade fetches packages', () async {
-      final String projectPath = await createProject(tempDir);
+      final String projectPath = await createProject(tempDir,
+        arguments: <String>['--no-pub', '--template=module']);
       removeGeneratedFiles(projectPath);
 
       await runCommandIn(projectPath, 'upgrade');
@@ -226,13 +229,14 @@
     }, timeout: allowForRemotePubInvocation);
 
     testUsingContext('get fetches packages and injects plugin', () async {
-      final String projectPath = await createProjectWithPlugin('path_provider');
+      final String projectPath = await createProjectWithPlugin('path_provider',
+        arguments: <String>['--no-pub', '--template=module']);
       removeGeneratedFiles(projectPath);
 
       await runCommandIn(projectPath, 'get');
 
       expectDependenciesResolved(projectPath);
-      expectApplicationPluginInjected(projectPath);
+      expectModulePluginInjected(projectPath);
     }, timeout: allowForRemotePubInvocation);
 
     testUsingContext('get fetches packages and injects plugin in plugin project', () async {