Solve-hint when a sdk-constraint is not nullable (#3688)

diff --git a/lib/src/sdk.dart b/lib/src/sdk.dart
index 3962648..909c61f 100644
--- a/lib/src/sdk.dart
+++ b/lib/src/sdk.dart
@@ -13,6 +13,9 @@
 /// An SDK that can provide packages and on which pubspecs can express version
 /// constraints.
 abstract class Sdk {
+  /// Is this the Dart sdk?
+  bool get isDartSdk => identifier == 'dart';
+
   /// This SDK's human-readable name.
   String get name;
 
diff --git a/lib/src/solver/incompatibility_cause.dart b/lib/src/solver/incompatibility_cause.dart
index a2a2327..f414c01 100644
--- a/lib/src/solver/incompatibility_cause.dart
+++ b/lib/src/solver/incompatibility_cause.dart
@@ -5,6 +5,7 @@
 import 'package:pub_semver/pub_semver.dart';
 
 import '../exceptions.dart';
+import '../language_version.dart';
 import '../sdk.dart';
 import 'incompatibility.dart';
 
@@ -96,6 +97,11 @@
 
   @override
   String? get hint {
+    if (sdk.isDartSdk &&
+        !LanguageVersion.fromSdkConstraint(constraint).supportsNullSafety &&
+        sdk.version! >= Version(3, 0, 0).firstPreRelease) {
+      return 'The lower bound of "$constraint" does not enable null safety.';
+    }
     // If the SDK is available, then installing it won't help
     if (sdk.isAvailable) {
       return null;
diff --git a/test/add/common/add_test.dart b/test/add/common/add_test.dart
index 41d9d6a..46ed234 100644
--- a/test/add/common/add_test.dart
+++ b/test/add/common/add_test.dart
@@ -16,14 +16,14 @@
   test('URL encodes the package name', () async {
     await servePackages();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['bad name!:1.2.3'],
         error: contains('Not a valid package name: "bad name!"'),
         exitCode: exit_codes.USAGE);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
 
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
@@ -37,7 +37,7 @@
       final server = await servePackages();
       server.serve('foo', '1.2.3');
 
-      await d.appDir({}).create();
+      await d.appDir(dependencies: {}).create();
 
       await pubAdd(args: ['foo:1.2.3']);
 
@@ -45,7 +45,7 @@
       await d.appPackageConfigFile([
         d.packageConfigEntry(name: 'foo', version: '1.2.3'),
       ]).validate();
-      await d.appDir({'foo': '1.2.3'}).validate();
+      await d.appDir(dependencies: {'foo': '1.2.3'}).validate();
     });
 
     test('adds multiple package from a pub server', () async {
@@ -54,7 +54,7 @@
       server.serve('bar', '1.1.0');
       server.serve('baz', '2.5.3');
 
-      await d.appDir({}).create();
+      await d.appDir(dependencies: {}).create();
 
       await pubAdd(args: ['foo:1.2.3', 'bar:1.1.0', 'baz:2.5.3']);
 
@@ -65,8 +65,11 @@
         d.packageConfigEntry(name: 'bar', version: '1.1.0'),
         d.packageConfigEntry(name: 'baz', version: '2.5.3'),
       ]).validate();
-      await d
-          .appDir({'foo': '1.2.3', 'bar': '1.1.0', 'baz': '2.5.3'}).validate();
+      await d.appDir(dependencies: {
+        'foo': '1.2.3',
+        'bar': '1.1.0',
+        'baz': '2.5.3'
+      }).validate();
     });
 
     test(
@@ -109,7 +112,7 @@
       final server = await servePackages();
       server.serve('foo', '1.2.3');
 
-      await d.appDir({}).create();
+      await d.appDir(dependencies: {}).create();
 
       await pubAdd(
           args: ['foo:1.2.3', '--dry-run'],
@@ -118,7 +121,7 @@
             contains('+ foo 1.2.3')
           ]));
 
-      await d.appDir({}).validate();
+      await d.appDir(dependencies: {}).validate();
       await d.dir(appPath, [
         d.nothing('.dart_tool/package_config.json'),
         d.nothing('pubspec.lock'),
@@ -151,7 +154,7 @@
       await d.appPackageConfigFile([
         d.packageConfigEntry(name: 'foo', version: '1.2.3'),
       ]).validate();
-      await d.appDir({'foo': '1.2.3'}).validate();
+      await d.appDir(dependencies: {'foo': '1.2.3'}).validate();
     });
 
     test('Inserts correctly when the pubspec is flow-style at top-level',
@@ -177,7 +180,7 @@
       await d.appPackageConfigFile([
         d.packageConfigEntry(name: 'foo', version: '1.2.3'),
       ]).validate();
-      await d.appDir({'foo': '1.2.3'}).validate();
+      await d.appDir(dependencies: {'foo': '1.2.3'}).validate();
     });
 
     group('notifies user about existing constraint', () {
@@ -186,7 +189,7 @@
           ..serve('foo', '1.2.3')
           ..serve('foo', '1.2.2');
 
-        await d.appDir({'foo': '1.2.2'}).create();
+        await d.appDir(dependencies: {'foo': '1.2.2'}).create();
 
         await pubAdd(
           args: ['foo'],
@@ -195,7 +198,7 @@
           ),
         );
 
-        await d.appDir({'foo': '^1.2.3'}).validate();
+        await d.appDir(dependencies: {'foo': '^1.2.3'}).validate();
       });
 
       test('if package is added with a specific version constraint', () async {
@@ -203,7 +206,7 @@
           ..serve('foo', '1.2.3')
           ..serve('foo', '1.2.2');
 
-        await d.appDir({'foo': '1.2.2'}).create();
+        await d.appDir(dependencies: {'foo': '1.2.2'}).create();
 
         await pubAdd(
           args: ['foo:1.2.3'],
@@ -212,7 +215,7 @@
           ),
         );
 
-        await d.appDir({'foo': '1.2.3'}).validate();
+        await d.appDir(dependencies: {'foo': '1.2.3'}).validate();
       });
 
       test('if package is added with a version constraint range', () async {
@@ -220,14 +223,14 @@
           ..serve('foo', '1.2.3')
           ..serve('foo', '1.2.2');
 
-        await d.appDir({'foo': '1.2.2'}).create();
+        await d.appDir(dependencies: {'foo': '1.2.2'}).create();
 
         await pubAdd(
             args: ['foo:>=1.2.2'],
             output: contains(
                 '"foo" is already in "dependencies". Will try to update the constraint.'));
 
-        await d.appDir({'foo': '>=1.2.2'}).validate();
+        await d.appDir(dependencies: {'foo': '>=1.2.2'}).validate();
       });
     });
 
@@ -926,7 +929,7 @@
     await pubGet();
 
     await pubAdd(args: ['bar']);
-    await d.appDir({'bar': '^1.0.0'}).validate();
+    await d.appDir(dependencies: {'bar': '^1.0.0'}).validate();
   });
 
   test('preserves comments', () async {
@@ -950,7 +953,7 @@
 
     await pubAdd(args: ['bar']);
 
-    await d.appDir({'bar': '^1.0.0', 'foo': '1.0.0'}).validate();
+    await d.appDir(dependencies: {'bar': '^1.0.0', 'foo': '1.0.0'}).validate();
     final fullPath = p.join(d.sandbox, appPath, 'pubspec.yaml');
 
     expect(File(fullPath).existsSync(), true);
diff --git a/test/add/common/invalid_options.dart b/test/add/common/invalid_options.dart
index f5bf23d..64be912 100644
--- a/test/add/common/invalid_options.dart
+++ b/test/add/common/invalid_options.dart
@@ -17,7 +17,7 @@
     await d
         .dir('bar', [d.libDir('bar'), d.libPubspec('foo', '0.0.1')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['foo', '--git-url', '../foo.git', '--path', '../bar'],
@@ -28,7 +28,7 @@
         ]),
         exitCode: exit_codes.USAGE);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
@@ -46,7 +46,7 @@
 
     await d
         .dir('bar', [d.libDir('bar'), d.libPubspec('foo', '0.0.1')]).create();
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: [
@@ -63,7 +63,7 @@
         ]),
         exitCode: exit_codes.USAGE);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
@@ -83,7 +83,7 @@
 
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: [
@@ -100,7 +100,7 @@
         ]),
         exitCode: exit_codes.USAGE);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
diff --git a/test/add/common/version_constraint_test.dart b/test/add/common/version_constraint_test.dart
index f058082..bf25d2e 100644
--- a/test/add/common/version_constraint_test.dart
+++ b/test/add/common/version_constraint_test.dart
@@ -17,7 +17,7 @@
       ..serve('foo', '2.0.0-dev')
       ..serve('foo', '1.3.4-dev');
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: ['foo']);
 
@@ -25,14 +25,14 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '1.2.3'),
     ]).validate();
-    await d.appDir({'foo': '^1.2.3'}).validate();
+    await d.appDir(dependencies: {'foo': '^1.2.3'}).validate();
   });
 
   test('allows specific version constraint', () async {
     final server = await servePackages();
     server.serve('foo', '1.2.3');
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: ['foo:1.2.3']);
 
@@ -40,14 +40,14 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '1.2.3'),
     ]).validate();
-    await d.appDir({'foo': '1.2.3'}).validate();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).validate();
   });
 
   test('allows specific pre-release version constraint', () async {
     final server = await servePackages();
     server.serve('foo', '1.2.3-dev');
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: ['foo:1.2.3-dev']);
 
@@ -55,7 +55,7 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '1.2.3-dev'),
     ]).validate();
-    await d.appDir({'foo': '1.2.3-dev'}).validate();
+    await d.appDir(dependencies: {'foo': '1.2.3-dev'}).validate();
   });
 
   test('allows the "any" version constraint', () async {
@@ -66,7 +66,7 @@
       ..serve('foo', '2.0.0-dev')
       ..serve('foo', '1.3.4-dev');
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: ['foo:any']);
 
@@ -74,14 +74,14 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '1.2.3'),
     ]).validate();
-    await d.appDir({'foo': 'any'}).validate();
+    await d.appDir(dependencies: {'foo': 'any'}).validate();
   });
 
   test('allows version constraint range', () async {
     final server = await servePackages();
     server.serve('foo', '1.2.3');
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: ['foo:>1.2.0 <2.0.0']);
 
@@ -89,7 +89,7 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '1.2.3'),
     ]).validate();
-    await d.appDir({'foo': '>1.2.0 <2.0.0'}).validate();
+    await d.appDir(dependencies: {'foo': '>1.2.0 <2.0.0'}).validate();
   });
 
   test(
@@ -101,11 +101,11 @@
       ..serve('bar', '2.0.3')
       ..serve('bar', '2.0.4');
 
-    await d.appDir({'bar': '2.0.3'}).create();
+    await d.appDir(dependencies: {'bar': '2.0.3'}).create();
 
     await pubAdd(args: ['foo']);
 
-    await d.appDir({'foo': '^0.1.0', 'bar': '2.0.3'}).validate();
+    await d.appDir(dependencies: {'foo': '^0.1.0', 'bar': '2.0.3'}).validate();
 
     await d.cacheDir({'foo': '0.1.0', 'bar': '2.0.3'}).validate();
     await d.appPackageConfigFile([
@@ -119,7 +119,7 @@
       final server = await servePackages();
       server.serve('foo', '1.0.3');
 
-      await d.appDir({}).create();
+      await d.appDir(dependencies: {}).create();
 
       await pubAdd(
           args: ['foo:>1.2.0 <2.0.0'],
@@ -128,7 +128,7 @@
               'match any versions, version solving failed.'),
           exitCode: exit_codes.DATA);
 
-      await d.appDir({}).validate();
+      await d.appDir(dependencies: {}).validate();
       await d.dir(appPath, [
         // The lockfile should not be created.
         d.nothing('pubspec.lock'),
@@ -143,7 +143,7 @@
         ..serve('bar', '2.0.3')
         ..serve('bar', '2.0.4');
 
-      await d.appDir({'bar': '2.0.3'}).create();
+      await d.appDir(dependencies: {'bar': '2.0.3'}).create();
 
       await pubAdd(
           args: ['foo:1.2.3'],
@@ -152,7 +152,7 @@
               'depends on bar 2.0.3, foo is forbidden.'),
           exitCode: exit_codes.DATA);
 
-      await d.appDir({'bar': '2.0.3'}).validate();
+      await d.appDir(dependencies: {'bar': '2.0.3'}).validate();
       await d.dir(appPath, [
         // The lockfile should not be created.
         d.nothing('pubspec.lock'),
diff --git a/test/add/common/version_resolution_test.dart b/test/add/common/version_resolution_test.dart
index 0f44d2b..b526dab 100644
--- a/test/add/common/version_resolution_test.dart
+++ b/test/add/common/version_resolution_test.dart
@@ -18,7 +18,7 @@
     server.serve('foo', '3.2.1');
     server.serve('bar', '1.0.0', deps: {'foo': '^3.2.1'});
 
-    await d.appDir({'bar': '1.0.0'}).create();
+    await d.appDir(dependencies: {'bar': '1.0.0'}).create();
     await pubGet();
 
     /// foo's package creator releases a newer version of foo, and we
@@ -30,7 +30,7 @@
 
     await pubAdd(args: ['foo']);
 
-    await d.appDir({'foo': '^3.5.0', 'bar': '1.0.0'}).validate();
+    await d.appDir(dependencies: {'foo': '^3.5.0', 'bar': '1.0.0'}).validate();
     await d.cacheDir({'foo': '3.5.0', 'bar': '1.0.0'}).validate();
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '3.5.0'),
@@ -47,7 +47,7 @@
     server.serve('foo', '3.2.1');
     server.serve('bar', '1.0.0', deps: {'foo': '^3.2.1'});
 
-    await d.appDir({'bar': '1.0.0'}).create();
+    await d.appDir(dependencies: {'bar': '1.0.0'}).create();
     await pubGet();
 
     server.serve('foo', '4.0.0');
@@ -55,7 +55,7 @@
 
     await pubAdd(args: ['foo']);
 
-    await d.appDir({'foo': '^3.2.1', 'bar': '1.0.0'}).validate();
+    await d.appDir(dependencies: {'foo': '^3.2.1', 'bar': '1.0.0'}).validate();
     await d.cacheDir({'foo': '3.2.1', 'bar': '1.0.0'}).validate();
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '3.2.1'),
@@ -72,7 +72,7 @@
     server.serve('foo', '3.2.1');
     server.serve('bar', '1.0.0', deps: {'foo': '^3.2.1'});
 
-    await d.appDir({'bar': '^1.0.0'}).create();
+    await d.appDir(dependencies: {'bar': '^1.0.0'}).create();
     await pubGet();
 
     server.serve('foo', '5.0.0');
@@ -82,7 +82,7 @@
 
     await pubAdd(args: ['foo']);
 
-    await d.appDir({'foo': '^4.0.0', 'bar': '^1.0.0'}).validate();
+    await d.appDir(dependencies: {'foo': '^4.0.0', 'bar': '^1.0.0'}).validate();
     await d.cacheDir({'foo': '4.0.0', 'bar': '1.5.0'}).validate();
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '4.0.0'),
diff --git a/test/add/git/git_test.dart b/test/add/git/git_test.dart
index 9890835..0897e7a 100644
--- a/test/add/git/git_test.dart
+++ b/test/add/git/git_test.dart
@@ -14,7 +14,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: ['foo', '--git-url', '../foo.git']);
 
@@ -25,7 +25,7 @@
       ])
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).validate();
   });
@@ -36,7 +36,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
       args: ['--directory', appPath, 'foo', '--git-url', 'foo.git'],
@@ -51,7 +51,7 @@
       ])
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).validate();
   });
@@ -62,7 +62,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
       args: ['foo', '--git-url', ':'],
@@ -78,7 +78,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: ['foo:1.0.0', '--git-url', '../foo.git']);
 
@@ -89,7 +89,7 @@
       ])
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git', 'version': '1.0.0'}
     }).validate();
   });
@@ -100,7 +100,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['foo:2.0.0', '--git-url', '../foo.git'],
@@ -109,7 +109,7 @@
             'any versions, version solving failed.'),
         exitCode: exit_codes.DATA);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
@@ -120,7 +120,7 @@
   test('fails when adding from an non-existing url', () async {
     ensureGit();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['foo', '--git-url', '../foo.git'],
@@ -128,7 +128,7 @@
             'git parameters'),
         exitCode: exit_codes.DATA);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
@@ -139,14 +139,14 @@
   test('fails if git-url is not declared', () async {
     ensureGit();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['foo', '--git-ref', 'master'],
         error: contains('The `--git-url` is required for git dependencies.'),
         exitCode: exit_codes.USAGE);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
@@ -189,7 +189,7 @@
   test('fails if multiple packages passed for git source', () async {
     ensureGit();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['foo', 'bar', 'baz', '--git-url', '../foo.git'],
@@ -201,7 +201,7 @@
     await d.git('foo.git', [
       d.dir('subdir', [d.libPubspec('foo', '1.2.3')])
     ]).create();
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
     await pubAdd(
       args: [
         '--directory',
@@ -212,7 +212,7 @@
       output: contains('Changed 1 dependency in myapp!'),
     );
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': {'url': '../foo.git', 'path': 'subdir'}
       }
@@ -227,7 +227,7 @@
     await d.git(
         'bar.git', [d.libDir('foo'), d.libPubspec('bar', '1.0.0')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: [
       'foo:{"git":"../foo.git"}',
diff --git a/test/add/git/ref_test.dart b/test/add/git/ref_test.dart
index 11dfc0b..de5073f 100644
--- a/test/add/git/ref_test.dart
+++ b/test/add/git/ref_test.dart
@@ -20,7 +20,7 @@
     await d.git('foo.git',
         [d.libDir('foo', 'foo 2'), d.libPubspec('foo', '1.0.0')]).commit();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: ['foo', '--git-url', '../foo.git', '--git-ref', 'old']);
 
@@ -33,7 +33,7 @@
       ])
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': {'url': '../foo.git', 'ref': 'old'}
       }
@@ -51,7 +51,7 @@
     await d.git('foo.git',
         [d.libDir('foo', 'foo 2'), d.libPubspec('foo', '1.0.0')]).commit();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['foo', '--git-url', '../foo.git', '--git-ref', 'old'],
@@ -59,7 +59,7 @@
             'git parameters'),
         exitCode: exit_codes.DATA);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
diff --git a/test/add/git/subdir_test.dart b/test/add/git/subdir_test.dart
index 8e8c39c..aa16109 100644
--- a/test/add/git/subdir_test.dart
+++ b/test/add/git/subdir_test.dart
@@ -17,7 +17,7 @@
 
     await repo.create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['sub', '--git-url', '../foo.git', '--git-path', 'subdir']);
@@ -36,7 +36,7 @@
           path: pathInCache('git/foo-${await repo.revParse('HEAD')}/subdir')),
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'sub': {
         'git': {'url': '../foo.git', 'path': 'subdir'}
       }
@@ -53,7 +53,7 @@
     ]);
     await repo.create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['sub', '--git-url', '../foo.git', '--git-path', 'sub/dir']);
@@ -75,7 +75,7 @@
           path: pathInCache('git/foo-${await repo.revParse('HEAD')}/sub/dir')),
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'sub': {
         'git': {'url': '../foo.git', 'path': 'sub/dir'}
       }
diff --git a/test/add/hosted/non_default_pub_server_test.dart b/test/add/hosted/non_default_pub_server_test.dart
index f93f292..8130332 100644
--- a/test/add/hosted/non_default_pub_server_test.dart
+++ b/test/add/hosted/non_default_pub_server_test.dart
@@ -19,7 +19,7 @@
     server.serve('foo', '1.1.0');
     server.serve('foo', '1.2.3');
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     final url = server.url;
 
@@ -31,7 +31,7 @@
       d.packageConfigEntry(name: 'foo', version: '1.2.3', server: server),
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '1.2.3',
         'hosted': {'name': 'foo', 'url': url}
@@ -52,7 +52,7 @@
     server.serve('baz', '0.1.3');
     server.serve('baz', '1.3.5');
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     final url = server.url;
 
@@ -68,7 +68,7 @@
       d.packageConfigEntry(name: 'baz', version: '1.3.5', server: server),
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '1.2.3',
         'hosted': {'name': 'foo', 'url': url}
@@ -87,7 +87,7 @@
   test('fails when adding from an invalid url', () async {
     ensureGit();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
       args: ['foo', '--hosted-url', 'https://invalid-url.foo'],
@@ -100,7 +100,7 @@
       },
     );
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
@@ -120,7 +120,7 @@
     server.serve('foo', '1.1.0');
     server.serve('foo', '1.2.3');
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     final url = server.url;
 
@@ -130,7 +130,7 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '1.2.3', server: server),
     ]).validate();
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '^1.2.3',
         'hosted': {'name': 'foo', 'url': url}
@@ -149,7 +149,7 @@
     server.serve('foo', '1.1.0');
     server.serve('foo', '1.2.3');
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     final url = server.url;
 
@@ -159,7 +159,7 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '1.2.3', server: server),
     ]).validate();
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '^1.2.3',
         'hosted': {'name': 'foo', 'url': url}
@@ -179,7 +179,7 @@
     server.serve('foo', '1.1.0');
     server.serve('foo', '1.2.3');
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     final url = server.url;
 
@@ -189,7 +189,7 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '1.2.3', server: server),
     ]).validate();
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': 'any',
         'hosted': {'name': 'foo', 'url': url}
diff --git a/test/add/path/absolute_path_test.dart b/test/add/path/absolute_path_test.dart
index afdc3f7..b5da9dd 100644
--- a/test/add/path/absolute_path_test.dart
+++ b/test/add/path/absolute_path_test.dart
@@ -14,7 +14,7 @@
     await d
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     final absolutePath = path.join(d.sandbox, 'foo');
 
@@ -24,7 +24,7 @@
       d.packageConfigEntry(name: 'foo', path: absolutePath),
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'path': absolutePath}
     }).validate();
   });
@@ -33,12 +33,12 @@
     await d
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
     final absolutePath = path.join(d.sandbox, 'foo');
 
     await pubAdd(args: ['foo:0.0.1', '--path', absolutePath]);
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'path': absolutePath, 'version': '0.0.1'}
     }).validate();
   });
@@ -49,7 +49,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
     final absolutePath = path.join(d.sandbox, 'foo');
 
     await pubAdd(
@@ -57,7 +57,7 @@
         error: contains('--path cannot be used with multiple packages.'),
         exitCode: exit_codes.USAGE);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
@@ -71,7 +71,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
     final absolutePath = path.join(d.sandbox, 'foo');
 
     await pubAdd(
@@ -82,7 +82,7 @@
             'failed.'),
         exitCode: exit_codes.DATA);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
@@ -91,7 +91,7 @@
   });
 
   test('fails if path does not exist', () async {
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     final absolutePath = path.join(d.sandbox, 'foo');
 
@@ -103,7 +103,7 @@
             'failed.'),
         exitCode: exit_codes.DATA);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
diff --git a/test/add/path/relative_path_test.dart b/test/add/path/relative_path_test.dart
index a25e557..c612f97 100644
--- a/test/add/path/relative_path_test.dart
+++ b/test/add/path/relative_path_test.dart
@@ -15,7 +15,7 @@
     await d
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: ['foo', '--path', '../foo']);
 
@@ -23,7 +23,7 @@
       d.packageConfigEntry(name: 'foo', path: '../foo'),
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'path': '../foo'}
     }).validate();
   });
@@ -52,7 +52,7 @@
     await d
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
       args: ['--directory', appPath, 'foo', '--path', 'foo'],
@@ -64,13 +64,13 @@
       d.packageConfigEntry(name: 'foo', path: '../foo'),
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'path': '../foo'}
     }).validate();
   });
 
   test('fails if path does not exist', () async {
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['foo', '--path', '../foo'],
@@ -80,7 +80,7 @@
             'version solving failed.'),
         exitCode: exit_codes.DATA);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
@@ -92,11 +92,11 @@
     await d
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(args: ['foo:0.0.1', '--path', '../foo']);
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'path': '../foo', 'version': '0.0.1'}
     }).validate();
   });
@@ -107,7 +107,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
         args: ['foo:2.0.0', '--path', '../foo'],
@@ -117,7 +117,7 @@
             'version solving failed.'),
         exitCode: exit_codes.DATA);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
@@ -162,7 +162,7 @@
     await d
         .dir('bar', [d.libDir('bar'), d.libPubspec('bar', '0.0.1')]).create();
 
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
 
     await pubAdd(
       args: [
@@ -180,7 +180,7 @@
       d.packageConfigEntry(name: 'bar', path: '../bar'),
     ]).validate();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'path': '../foo'},
       'bar': {'path': '../bar'},
     }).validate();
diff --git a/test/add/sdk/sdk_test.dart b/test/add/sdk/sdk_test.dart
index 7c81727..bba4b91 100644
--- a/test/add/sdk/sdk_test.dart
+++ b/test/add/sdk/sdk_test.dart
@@ -30,7 +30,7 @@
   });
 
   test("adds an SDK dependency's dependencies", () async {
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
     await pubAdd(
         args: ['foo', '--sdk', 'flutter'],
         environment: {'FLUTTER_ROOT': p.join(d.sandbox, 'flutter')});
@@ -54,7 +54,7 @@
   test(
       "adds an SDK dependency's dependencies with version constraint specified",
       () async {
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
     await pubAdd(
         args: ['foo:0.0.1', '--sdk', 'flutter'],
         environment: {'FLUTTER_ROOT': p.join(d.sandbox, 'flutter')});
@@ -75,7 +75,7 @@
   });
 
   test('adds an SDK dependency from bin/cache/pkg', () async {
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
     await pubAdd(
         args: ['baz', '--sdk', 'flutter'],
         environment: {'FLUTTER_ROOT': p.join(d.sandbox, 'flutter')});
@@ -88,7 +88,7 @@
   });
 
   test("fails if the version constraint doesn't match", () async {
-    await d.appDir({}).create();
+    await d.appDir(dependencies: {}).create();
     await pubAdd(
         args: ['foo:^1.0.0', '--sdk', 'flutter'],
         environment: {'FLUTTER_ROOT': p.join(d.sandbox, 'flutter')},
@@ -98,7 +98,7 @@
             """),
         exitCode: exit_codes.DATA);
 
-    await d.appDir({}).validate();
+    await d.appDir(dependencies: {}).validate();
     await d.dir(appPath, [
       d.nothing('.dart_tool/package_config.json'),
       d.nothing('pubspec.lock'),
diff --git a/test/cache/clean_test.dart b/test/cache/clean_test.dart
index b5909b5..c65328b 100644
--- a/test/cache/clean_test.dart
+++ b/test/cache/clean_test.dart
@@ -20,7 +20,7 @@
     await servePackages()
       ..serve('foo', '1.1.2')
       ..serve('bar', '1.2.3');
-    await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
     await pubGet();
     final cache = path.join(d.sandbox, cachePath);
     expect(listDir(cache, includeHidden: true), contains(endsWith('hosted')));
@@ -39,7 +39,7 @@
     await servePackages()
       ..serve('foo', '1.1.2')
       ..serve('bar', '1.2.3');
-    await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
     await pubGet();
     final cache = path.join(d.sandbox, cachePath);
     expect(
diff --git a/test/cache/create_readme_test.dart b/test/cache/create_readme_test.dart
index 035fd68..70a02a6 100644
--- a/test/cache/create_readme_test.dart
+++ b/test/cache/create_readme_test.dart
@@ -14,7 +14,7 @@
     await pubGet();
     await d.nothing(cachePath).validate();
 
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await pubGet();
     await d.dir(cachePath, [
       d.file('README.md', contains('https://dart.dev/go/pub-cache'))
@@ -28,7 +28,7 @@
   test('PUB_CACHE/README.md gets created by `dart pub cache clean`', () async {
     final server = await servePackages();
     server.serve('foo', '1.0.0');
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await pubGet();
     await d.dir(cachePath, [
       d.file('README.md', contains('https://dart.dev/go/pub-cache'))
diff --git a/test/cache/preload_test.dart b/test/cache/preload_test.dart
index 3bf5f64..3fcb125 100644
--- a/test/cache/preload_test.dart
+++ b/test/cache/preload_test.dart
@@ -19,7 +19,7 @@
     server.serve('foo', '1.0.0');
     server.serve('foo', '2.0.0');
 
-    await appDir({'foo': '^2.0.0'}).create();
+    await appDir(dependencies: {'foo': '^2.0.0'}).create();
     // Do a `pub get` here to create a lock file in order to validate we later can
     // `pub get --offline` with packages installed by `preload`.
     await pubGet();
diff --git a/test/cache/repair/git_test.dart b/test/cache/repair/git_test.dart
index 262343a..46f11a5 100644
--- a/test/cache/repair/git_test.dart
+++ b/test/cache/repair/git_test.dart
@@ -17,7 +17,7 @@
       await d.git(
           'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {'git': '../foo.git'}
       }).create();
       await pubGet();
@@ -123,7 +123,7 @@
         d.dir('subdir', [d.libDir('sub'), d.libPubspec('sub', '1.0.0')])
       ]).create();
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'sub': {
           'git': {'url': '../foo.git', 'path': 'subdir'}
         }
diff --git a/test/content_hash_test.dart b/test/content_hash_test.dart
index 2485918..62ef1ea 100644
--- a/test/content_hash_test.dart
+++ b/test/content_hash_test.dart
@@ -19,7 +19,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0');
     server.serveContentHashes = true;
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
     final lockfile = loadYaml(
         File(p.join(sandbox, appPath, 'pubspec.lock')).readAsStringSync());
@@ -36,7 +36,7 @@
     final server = await servePackages();
     server.serveContentHashes = false;
     server.serve('foo', '1.0.0');
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
     final lockfile = loadYaml(
         File(p.join(sandbox, appPath, 'pubspec.lock')).readAsStringSync());
@@ -52,7 +52,7 @@
     server.serve('foo', '1.0.0');
     server.overrideArchiveSha256('foo', '1.0.0',
         'e7a7a0f6d9873e4c40cf68cc3cc9ca5b6c8cef6a2220241bdada4b9cb0083279');
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
     await pubGet(
       exitCode: exit_codes.TEMP_FAIL,
       silent: contains('Attempt #2'),
@@ -69,7 +69,7 @@
     final server = await servePackages();
     server.serveContentHashes = true;
     server.serve('foo', '1.0.0');
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
     server.serve('foo', '1.0.0',
         contents: [file('new_file.txt', 'This file could be malicious.')]);
@@ -100,7 +100,7 @@
     final server = await servePackages();
     server.serveContentHashes = false;
     server.serve('foo', '1.0.0');
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
     server.serve('foo', '1.0.0',
         contents: [file('new_file.txt', 'This file could be malicious.')]);
@@ -130,7 +130,7 @@
     final server = await servePackages();
     server.serveContentHashes = false;
     server.serve('foo', '1.0.0');
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
     final lockfile = loadYaml(
         File(p.join(sandbox, appPath, 'pubspec.lock')).readAsStringSync());
@@ -153,7 +153,7 @@
     final server = await servePackages();
     server.serveContentHashes = true;
     server.serve('foo', '1.0.0');
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
     final lockfile = loadYaml(
         File(p.join(sandbox, appPath, 'pubspec.lock')).readAsStringSync());
@@ -176,7 +176,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0');
     server.serveContentHashes = false;
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
     // Pretend we had no hash in the lockfile.
     final lockfile = YamlEditor(
@@ -201,7 +201,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0');
     server.serveContentHashes = true;
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
     // Pretend we had no hash in the lockfile.
     final lockfile = YamlEditor(
diff --git a/test/dart3_sdk_constraint_hack_test.dart b/test/dart3_sdk_constraint_hack_test.dart
index c87f2b6..25da55a 100644
--- a/test/dart3_sdk_constraint_hack_test.dart
+++ b/test/dart3_sdk_constraint_hack_test.dart
@@ -126,4 +126,24 @@
       ),
     );
   });
+
+  test('When the constraint is not rewritten, a helpful hint is given',
+      () async {
+    await d.appDir(dependencies: {
+      'foo': 'any'
+    }, pubspec: {
+      'environment': {'sdk': '^2.12.0'}
+    }).create();
+    final server = await servePackages();
+
+    // foo is not null safe.
+    server.serve('foo', '1.0.0', pubspec: {
+      'environment': {'sdk': '>=2.10.0 <3.0.0'}
+    });
+    await pubGet(
+      error: contains(
+        'The lower bound of ">=2.10.0 <3.0.0" does not enable null safety.',
+      ),
+    );
+  });
 }
diff --git a/test/dependency_services/dependency_services_test.dart b/test/dependency_services/dependency_services_test.dart
index 1451d42..115c730 100644
--- a/test/dependency_services/dependency_services_test.dart
+++ b/test/dependency_services/dependency_services_test.dart
@@ -339,7 +339,7 @@
     server.serve('foo', '1.0.0');
     await d.dir('bar', [d.libPubspec('bar', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': '^1.0.0',
       'bar': {'path': '../bar'}
     }).create();
@@ -360,7 +360,7 @@
     await d.git('foo.git', [d.libPubspec('foo', '1.0.0')]).create();
     await d.git('bar.git', [d.libPubspec('bar', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': {'url': '../foo.git'}
       },
diff --git a/test/deps/executables_test.dart b/test/deps/executables_test.dart
index ea864fd..d2fe272 100644
--- a/test/deps/executables_test.dart
+++ b/test/deps/executables_test.dart
@@ -62,7 +62,7 @@
     ]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
@@ -73,7 +73,7 @@
   testWithGolden('lists executables only from immediate dependencies',
       (ctx) async {
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
@@ -95,7 +95,7 @@
 
   testWithGolden('applies formatting before printing executables', (ctx) async {
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'},
         'bar': {'path': '../bar'}
       }),
diff --git a/test/descriptor.dart b/test/descriptor.dart
index 8f0f49b..e418827 100644
--- a/test/descriptor.dart
+++ b/test/descriptor.dart
@@ -81,9 +81,10 @@
 
 /// Describes a file named `pubspec.yaml` for an application package with the
 /// given [dependencies].
-Descriptor appPubspec([Map? dependencies]) {
+Descriptor appPubspec({Map? dependencies, Map<String, Object>? extras}) {
   var map = <String, Object>{
     'name': 'myapp',
+    ...?extras,
   };
   if (dependencies != null) map['dependencies'] = dependencies;
   return pubspec(map);
@@ -275,8 +276,8 @@
 
 /// Describes the application directory, containing only a pubspec specifying
 /// the given [dependencies].
-DirectoryDescriptor appDir([Map? dependencies]) =>
-    dir(appPath, [appPubspec(dependencies)]);
+DirectoryDescriptor appDir({Map? dependencies, Map<String, Object>? pubspec}) =>
+    dir(appPath, [appPubspec(dependencies: dependencies, extras: pubspec)]);
 
 /// Describes a `.dart_tools/package_config.json` file.
 ///
diff --git a/test/dev_dependency_test.dart b/test/dev_dependency_test.dart
index b192444..e667b54 100644
--- a/test/dev_dependency_test.dart
+++ b/test/dev_dependency_test.dart
@@ -77,7 +77,7 @@
         .dir('bar', [d.libDir('bar'), d.libPubspec('bar', '0.0.1')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
diff --git a/test/downgrade/does_not_show_other_versions_test.dart b/test/downgrade/does_not_show_other_versions_test.dart
index 884bbaf..da3ec19 100644
--- a/test/downgrade/does_not_show_other_versions_test.dart
+++ b/test/downgrade/does_not_show_other_versions_test.dart
@@ -14,12 +14,12 @@
       ..serve('downgraded', '2.0.0')
       ..serve('downgraded', '3.0.0-dev');
 
-    await d.appDir({'downgraded': '3.0.0-dev'}).create();
+    await d.appDir(dependencies: {'downgraded': '3.0.0-dev'}).create();
 
     await pubGet();
 
     // Loosen the constraints.
-    await d.appDir({'downgraded': '>=2.0.0'}).create();
+    await d.appDir(dependencies: {'downgraded': '>=2.0.0'}).create();
 
     await pubDowngrade(output: contains('downgraded 2.0.0 (was 3.0.0-dev)'));
   });
diff --git a/test/downgrade/doesnt_change_git_dependencies_test.dart b/test/downgrade/doesnt_change_git_dependencies_test.dart
index 1450af5..10a1297 100644
--- a/test/downgrade/doesnt_change_git_dependencies_test.dart
+++ b/test/downgrade/doesnt_change_git_dependencies_test.dart
@@ -14,7 +14,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/downgrade/dry_run_does_not_apply_changes_test.dart b/test/downgrade/dry_run_does_not_apply_changes_test.dart
index 38fbebe..4fcf8d7 100644
--- a/test/downgrade/dry_run_does_not_apply_changes_test.dart
+++ b/test/downgrade/dry_run_does_not_apply_changes_test.dart
@@ -16,12 +16,12 @@
       ..serve('foo', '2.0.0');
 
     // Create the first lockfile.
-    await d.appDir({'foo': '2.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '2.0.0'}).create();
 
     await pubGet();
 
     // Change the pubspec.
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     // Also delete the "packages" directory.
     deleteEntry(path.join(d.sandbox, appPath, 'packages'));
diff --git a/test/downgrade/unlock_if_necessary_test.dart b/test/downgrade/unlock_if_necessary_test.dart
index c8b55af..96d789d 100644
--- a/test/downgrade/unlock_if_necessary_test.dart
+++ b/test/downgrade/unlock_if_necessary_test.dart
@@ -15,7 +15,7 @@
     server.serve('foo', '2.0.0', deps: {'foo_dep': 'any'});
     server.serve('foo_dep', '2.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet();
 
diff --git a/test/downgrade/unlock_single_package_test.dart b/test/downgrade/unlock_single_package_test.dart
index 1188e41..cbac548 100644
--- a/test/downgrade/unlock_single_package_test.dart
+++ b/test/downgrade/unlock_single_package_test.dart
@@ -13,7 +13,7 @@
     server.serve('foo', '2.1.0', deps: {'bar': '>1.0.0'});
     server.serve('bar', '2.1.0');
 
-    await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
 
     await pubGet();
     await d.appPackageConfigFile([
@@ -52,7 +52,7 @@
       ..serve('foo', '2.0.0')
       ..serve('foo', '2.1.0');
 
-    await d.appDir({'foo': '^2.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '^2.0.0'}).create();
 
     await pubGet();
     await d.appPackageConfigFile([
diff --git a/test/embedding/embedding_test.dart b/test/embedding/embedding_test.dart
index 07d9d15..3aaf53b 100644
--- a/test/embedding/embedding_test.dart
+++ b/test/embedding/embedding_test.dart
@@ -117,7 +117,7 @@
       (context) async {
     final server = await servePackages();
     server.serve('foo', '1.0.0');
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     // TODO(sigurdm) This logs the entire verbose trace to a golden file.
     //
@@ -164,7 +164,7 @@
       })
     ]).create();
     final app = d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': '1.0.0',
         // The path dependency should not go to analytics.
         'dep': {'path': '../dep'}
@@ -241,7 +241,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0');
     server.serve('foo', '2.0.0');
-    await d.appDir({'foo': '^1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '^1.0.0'}).create();
     await context.runEmbedding(
       ['pub', '--no-color', 'get'],
       environment: getPubTestEnvironment(),
diff --git a/test/get/dry_run_does_not_apply_changes_test.dart b/test/get/dry_run_does_not_apply_changes_test.dart
index 3e44bf9..22ec5d2 100644
--- a/test/get/dry_run_does_not_apply_changes_test.dart
+++ b/test/get/dry_run_does_not_apply_changes_test.dart
@@ -12,7 +12,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0');
 
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
 
     await pubGet(
         args: ['--dry-run'],
diff --git a/test/get/enforce_lockfile_test.dart b/test/get/enforce_lockfile_test.dart
index 979db08..0986802 100644
--- a/test/get/enforce_lockfile_test.dart
+++ b/test/get/enforce_lockfile_test.dart
@@ -16,7 +16,7 @@
       () async {
     final server = await servePackages();
     server.serve('foo', '1.0.0');
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
     final packageConfig =
         File(path(p.join(appPath, '.dart_tool', 'package_config.json')));
@@ -31,7 +31,7 @@
   });
 
   test('Refuses to get if no lockfile exists', () async {
-    await appDir({}).create();
+    await appDir(dependencies: {}).create();
     await pubGet(
       args: ['--enforce-lockfile'],
       error: '''
@@ -49,7 +49,7 @@
     server.serve('foo', '1.0.0');
     server.serve('bar', '1.0.0');
 
-    await appDir({'foo': '^1.0.0'}).create();
+    await appDir(dependencies: {'foo': '^1.0.0'}).create();
     await dir(appPath, [
       dir('example', [
         libPubspec('example', '0.0.0', deps: {
@@ -87,9 +87,9 @@
   test('Refuses to get if lockfile is missing package', () async {
     final server = await servePackages();
     server.serve('foo', '1.0.0');
-    await appDir({}).create();
+    await appDir(dependencies: {}).create();
     await pubGet();
-    await appDir({'foo': 'any'}).create();
+    await appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet(
       args: ['--enforce-lockfile'],
@@ -107,9 +107,9 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0');
     server.serve('foo', '2.0.0');
-    await appDir({'foo': '^1.0.0'}).create();
+    await appDir(dependencies: {'foo': '^1.0.0'}).create();
     await pubGet();
-    await appDir({'foo': '^2.0.0'}).create();
+    await appDir(dependencies: {'foo': '^2.0.0'}).create();
     await pubGet(
       args: ['--enforce-lockfile'],
       output: allOf([
@@ -126,7 +126,7 @@
     final server = await servePackages();
     server.serveContentHashes = true;
     server.serve('foo', '1.0.0');
-    await appDir({'foo': '^1.0.0'}).create();
+    await appDir(dependencies: {'foo': '^1.0.0'}).create();
     await pubGet();
     server.serve('foo', '1.0.0', contents: [
       file('README.md', 'Including this will change the content-hash.'),
@@ -163,7 +163,7 @@
     final server = await servePackages();
     server.serveContentHashes = false;
     server.serve('foo', '1.0.0');
-    await appDir({'foo': '^1.0.0'}).create();
+    await appDir(dependencies: {'foo': '^1.0.0'}).create();
     await pubGet();
     await runPub(args: ['cache', 'clean', '-f']);
     server.serve('foo', '1.0.0', contents: [
diff --git a/test/get/get_inside_cache_fails_test.dart b/test/get/get_inside_cache_fails_test.dart
index d49fcbb..d8dc860 100644
--- a/test/get/get_inside_cache_fails_test.dart
+++ b/test/get/get_inside_cache_fails_test.dart
@@ -12,7 +12,7 @@
   test('`pub get` inside the cache fails gracefully', () async {
     final server = await servePackages();
     server.serve('foo', '1.0.0');
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet();
 
diff --git a/test/get/git/check_out_and_upgrade_test.dart b/test/get/git/check_out_and_upgrade_test.dart
index 42044af..cd6b1ad 100644
--- a/test/get/git/check_out_and_upgrade_test.dart
+++ b/test/get/git/check_out_and_upgrade_test.dart
@@ -14,7 +14,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/get/git/check_out_branch_test.dart b/test/get/git/check_out_branch_test.dart
index 104c8b9..002811c 100644
--- a/test/get/git/check_out_branch_test.dart
+++ b/test/get/git/check_out_branch_test.dart
@@ -19,7 +19,7 @@
     await d.git('foo.git',
         [d.libDir('foo', 'foo 2'), d.libPubspec('foo', '1.0.0')]).commit();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': {'url': '../foo.git', 'ref': 'old'}
       }
diff --git a/test/get/git/check_out_revision_test.dart b/test/get/git/check_out_revision_test.dart
index 2428d7c..088ffd3 100644
--- a/test/get/git/check_out_revision_test.dart
+++ b/test/get/git/check_out_revision_test.dart
@@ -19,7 +19,7 @@
     await d.git('foo.git',
         [d.libDir('foo', 'foo 2'), d.libPubspec('foo', '1.0.0')]).commit();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': {'url': '../foo.git', 'ref': commit}
       }
diff --git a/test/get/git/check_out_test.dart b/test/get/git/check_out_test.dart
index 3aaf72e..aa020b0 100644
--- a/test/get/git/check_out_test.dart
+++ b/test/get/git/check_out_test.dart
@@ -21,7 +21,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
@@ -55,7 +55,7 @@
 '''),
     ]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
@@ -78,7 +78,7 @@
     final server =
         await _serveDirectory(p.join(descriptor.io.path, '.git'), funkyName);
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': 'http://localhost:${server.url.port}/$funkyName'}
     }).create();
 
diff --git a/test/get/git/check_out_transitive_test.dart b/test/get/git/check_out_transitive_test.dart
index 0587c58..cd2a43d 100644
--- a/test/get/git/check_out_transitive_test.dart
+++ b/test/get/git/check_out_transitive_test.dart
@@ -26,7 +26,7 @@
     await d.git(
         'bar.git', [d.libDir('bar'), d.libPubspec('bar', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': p.toUri(p.absolute(d.sandbox, appPath, '../foo.git')).toString()
       }
@@ -60,7 +60,7 @@
     await d.git(
         'bar.git', [d.libDir('bar'), d.libPubspec('bar', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': p.toUri(p.absolute(d.sandbox, appPath, '../foo.git')).toString()
       }
@@ -87,7 +87,7 @@
     await d
         .dir('bar', [d.libDir('bar'), d.libPubspec('bar', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': p.toUri(p.absolute(d.sandbox, appPath, '../foo.git')).toString()
       }
diff --git a/test/get/git/check_out_twice_test.dart b/test/get/git/check_out_twice_test.dart
index b6de388..3806bcf 100644
--- a/test/get/git/check_out_twice_test.dart
+++ b/test/get/git/check_out_twice_test.dart
@@ -14,7 +14,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/get/git/check_out_unfetched_revision_of_cached_repo_test.dart b/test/get/git/check_out_unfetched_revision_of_cached_repo_test.dart
index dae234d..888ab2f 100644
--- a/test/get/git/check_out_unfetched_revision_of_cached_repo_test.dart
+++ b/test/get/git/check_out_unfetched_revision_of_cached_repo_test.dart
@@ -22,7 +22,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/get/git/check_out_with_trailing_slash_test.dart b/test/get/git/check_out_with_trailing_slash_test.dart
index 5838986..b38f4c4 100644
--- a/test/get/git/check_out_with_trailing_slash_test.dart
+++ b/test/get/git/check_out_with_trailing_slash_test.dart
@@ -15,7 +15,7 @@
       await d.git(
           'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {'git': '../foo.git/'}
       }).create();
 
diff --git a/test/get/git/clean_invalid_git_repo_cache_test.dart b/test/get/git/clean_invalid_git_repo_cache_test.dart
index ab386ab..97bfd72 100644
--- a/test/get/git/clean_invalid_git_repo_cache_test.dart
+++ b/test/get/git/clean_invalid_git_repo_cache_test.dart
@@ -30,7 +30,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
@@ -56,7 +56,7 @@
     await repo.create();
     await repo.runGit(['branch', 'old']);
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': {'url': '../foo.git', 'ref': 'old'}
       }
@@ -84,7 +84,7 @@
     await repo.create();
     var commit = await repo.revParse('HEAD');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': {'url': '../foo.git', 'ref': commit}
       }
diff --git a/test/get/git/dependency_name_match_pubspec_test.dart b/test/get/git/dependency_name_match_pubspec_test.dart
index 1545fca..788bfdf 100644
--- a/test/get/git/dependency_name_match_pubspec_test.dart
+++ b/test/get/git/dependency_name_match_pubspec_test.dart
@@ -18,7 +18,7 @@
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'weirdname': {'git': '../foo.git'}
       })
     ]).create();
diff --git a/test/get/git/different_repo_name_test.dart b/test/get/git/different_repo_name_test.dart
index 1d8f9c4..8d91fdb 100644
--- a/test/get/git/different_repo_name_test.dart
+++ b/test/get/git/different_repo_name_test.dart
@@ -17,7 +17,7 @@
         [d.libDir('weirdname'), d.libPubspec('weirdname', '1.0.0')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'weirdname': {'git': '../foo.git'}
       })
     ]).create();
diff --git a/test/get/git/doesnt_fetch_if_nothing_changes_test.dart b/test/get/git/doesnt_fetch_if_nothing_changes_test.dart
index 3d9f040..171a868 100644
--- a/test/get/git/doesnt_fetch_if_nothing_changes_test.dart
+++ b/test/get/git/doesnt_fetch_if_nothing_changes_test.dart
@@ -16,7 +16,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': {'url': '../foo.git'}
       }
diff --git a/test/get/git/git_not_installed_test.dart b/test/get/git/git_not_installed_test.dart
index e590770..bd44635 100644
--- a/test/get/git/git_not_installed_test.dart
+++ b/test/get/git/git_not_installed_test.dart
@@ -19,7 +19,7 @@
 ''', batch: '''
 echo "not git"
 ''');
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
@@ -51,7 +51,7 @@
 
     await d.git('foo.git', [d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/get/git/lock_version_test.dart b/test/get/git/lock_version_test.dart
index 40b2708..65daef3 100644
--- a/test/get/git/lock_version_test.dart
+++ b/test/get/git/lock_version_test.dart
@@ -16,7 +16,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/get/git/locked_revision_without_repo_test.dart b/test/get/git/locked_revision_without_repo_test.dart
index c00c730..0282c29 100644
--- a/test/get/git/locked_revision_without_repo_test.dart
+++ b/test/get/git/locked_revision_without_repo_test.dart
@@ -18,7 +18,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/get/git/path_test.dart b/test/get/git/path_test.dart
index d9c9195..9612dc5 100644
--- a/test/get/git/path_test.dart
+++ b/test/get/git/path_test.dart
@@ -22,7 +22,7 @@
     ]);
     await repo.create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'sub': {
         'git': {'url': '../foo.git', 'path': 'subdir'}
       }
@@ -56,7 +56,7 @@
     ]);
     await repo.create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'sub': {
         'git': {'url': '../foo.git', 'path': 'sub/dir%25'}
       }
@@ -94,7 +94,7 @@
 
   group('requires path to be absolute', () {
     test('absolute path', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'sub': {
           'git': {'url': '../foo.git', 'path': '/subdir'}
         }
@@ -108,7 +108,7 @@
       );
     });
     test('scheme', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'sub': {
           'git': {'url': '../foo.git', 'path': 'https://subdir'}
         }
@@ -122,7 +122,7 @@
       );
     });
     test('fragment', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'sub': {
           'git': {'url': '../foo.git', 'path': 'subdir/dir#fragment'}
         }
@@ -137,7 +137,7 @@
     });
 
     test('query', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'sub': {
           'git': {'url': '../foo.git', 'path': 'subdir/dir?query'}
         }
@@ -152,7 +152,7 @@
     });
 
     test('authority', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'sub': {
           'git': {
             'url': '../foo.git',
@@ -181,7 +181,7 @@
     ]);
     await repo.create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'sub': {
         'git': {
           'url': p.toUri(p.join(d.sandbox, 'foo.git')).toString(),
@@ -231,7 +231,7 @@
     ]);
     await repo.create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'sub1': {
         'git': {'url': '../foo.git', 'path': 'subdir1'}
       },
@@ -281,7 +281,7 @@
     ]).commit();
     var newRevision = await repo.revParse('HEAD');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'sub1': {
         'git': {'url': '../foo.git', 'path': 'subdir', 'ref': oldRevision}
       },
diff --git a/test/get/git/require_pubspec_name_test.dart b/test/get/git/require_pubspec_name_test.dart
index adc31e4..2322687 100644
--- a/test/get/git/require_pubspec_name_test.dart
+++ b/test/get/git/require_pubspec_name_test.dart
@@ -16,7 +16,7 @@
 
     await d.git('foo.git', [d.libDir('foo'), d.pubspec({})]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/get/git/require_pubspec_test.dart b/test/get/git/require_pubspec_test.dart
index 0f75c75..8489da1 100644
--- a/test/get/git/require_pubspec_test.dart
+++ b/test/get/git/require_pubspec_test.dart
@@ -13,7 +13,7 @@
 
     await d.git('foo.git', [d.libDir('foo')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/get/git/stay_locked_if_compatible_test.dart b/test/get/git/stay_locked_if_compatible_test.dart
index d7f6eb9..d00715d 100644
--- a/test/get/git/stay_locked_if_compatible_test.dart
+++ b/test/get/git/stay_locked_if_compatible_test.dart
@@ -16,7 +16,7 @@
     await d.git('foo.git',
         [d.libDir('foo', 'foo 1.0.0'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
@@ -27,7 +27,7 @@
     await d.git('foo.git',
         [d.libDir('foo', 'foo 1.0.1'), d.libPubspec('foo', '1.0.1')]).commit();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git', 'version': '>=1.0.0'}
     }).create();
 
diff --git a/test/get/git/unlock_if_incompatible_test.dart b/test/get/git/unlock_if_incompatible_test.dart
index 61b60e6..8bb3507 100644
--- a/test/get/git/unlock_if_incompatible_test.dart
+++ b/test/get/git/unlock_if_incompatible_test.dart
@@ -16,7 +16,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '0.5.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
@@ -36,7 +36,7 @@
     await d.git('foo.git',
         [d.libDir('foo', 'foo 2'), d.libPubspec('foo', '1.0.0')]).commit();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git', 'version': '>=1.0.0'}
     }).create();
 
diff --git a/test/get/hosted/avoid_network_requests_test.dart b/test/get/hosted/avoid_network_requests_test.dart
index c62fa7c..bbc73a4 100644
--- a/test/get/hosted/avoid_network_requests_test.dart
+++ b/test/get/hosted/avoid_network_requests_test.dart
@@ -17,7 +17,7 @@
       ..serve('bar', '1.1.0')
       ..serve('bar', '1.2.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     // Get once so it gets cached.
     await pubGet();
@@ -27,7 +27,7 @@
     globalServer.requestedPaths.clear();
 
     // Add "bar" to the dependencies.
-    await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
 
     // Run the solver again.
     await pubGet();
diff --git a/test/get/hosted/cached_pubspec_test.dart b/test/get/hosted/cached_pubspec_test.dart
index fa9decc..161dae9 100644
--- a/test/get/hosted/cached_pubspec_test.dart
+++ b/test/get/hosted/cached_pubspec_test.dart
@@ -12,7 +12,7 @@
     final server = await servePackages();
     server.serve('foo', '1.2.3');
 
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     // Get once so it gets cached.
     await pubGet();
diff --git a/test/get/hosted/do_not_upgrade_on_removed_constraints_test.dart b/test/get/hosted/do_not_upgrade_on_removed_constraints_test.dart
index 44fe075..09f7b78 100644
--- a/test/get/hosted/do_not_upgrade_on_removed_constraints_test.dart
+++ b/test/get/hosted/do_not_upgrade_on_removed_constraints_test.dart
@@ -17,7 +17,7 @@
       ..serve('shared_dep', '1.0.0')
       ..serve('shared_dep', '2.0.0');
 
-    await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
 
     await pubGet();
 
@@ -27,7 +27,7 @@
       d.packageConfigEntry(name: 'shared_dep', version: '1.0.0'),
     ]).validate();
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet();
 
diff --git a/test/get/hosted/does_no_network_requests_when_possible_test.dart b/test/get/hosted/does_no_network_requests_when_possible_test.dart
index 4324776..0739f19 100644
--- a/test/get/hosted/does_no_network_requests_when_possible_test.dart
+++ b/test/get/hosted/does_no_network_requests_when_possible_test.dart
@@ -14,7 +14,7 @@
       ..serve('foo', '1.1.0')
       ..serve('foo', '1.2.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     // Get once so it gets cached.
     await pubGet();
diff --git a/test/get/hosted/explain_bad_hosted_url_test.dart b/test/get/hosted/explain_bad_hosted_url_test.dart
index feebf67..fb44e52 100644
--- a/test/get/hosted/explain_bad_hosted_url_test.dart
+++ b/test/get/hosted/explain_bad_hosted_url_test.dart
@@ -9,7 +9,7 @@
 
 void main() {
   test('Complains nicely about invalid PUB_HOSTED_URL', () async {
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     // Get once so it gets cached.
     await pubGet(
@@ -34,7 +34,7 @@
   test('Allows PUB_HOSTED_URL to end with a slash', () async {
     final server = await servePackages();
     server.serve('foo', '1.0.0');
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet(
       environment: {'PUB_HOSTED_URL': '${globalServer.url}/'},
diff --git a/test/get/hosted/get_stress_test.dart b/test/get/hosted/get_stress_test.dart
index 026c0c1..356864d 100644
--- a/test/get/hosted/get_stress_test.dart
+++ b/test/get/hosted/get_stress_test.dart
@@ -15,7 +15,7 @@
       server.serve('pkg$i', '1.$i.0');
     }
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': '1.2.3',
       for (var i = 0; i < 20; i++) 'pkg$i': '^1.$i.0',
     }).create();
diff --git a/test/get/hosted/get_test.dart b/test/get/hosted/get_test.dart
index 837fb32..4349dc7 100644
--- a/test/get/hosted/get_test.dart
+++ b/test/get/hosted/get_test.dart
@@ -19,7 +19,7 @@
 
     expect(await server.peekArchiveChecksumHeader('foo', '1.2.3'), isNotNull);
 
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     await pubGet();
 
@@ -47,7 +47,7 @@
     test('because of omitted checksum header', () async {
       expect(await server.peekArchiveChecksumHeader('foo', '1.2.3'), isNull);
 
-      await d.appDir({'foo': '1.2.3'}).create();
+      await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
       await pubGet();
 
@@ -60,7 +60,7 @@
     test('because of empty checksum header', () async {
       expect(await server.peekArchiveChecksumHeader('bar', '1.2.3'), '');
 
-      await d.appDir({'bar': '1.2.3'}).create();
+      await d.appDir(dependencies: {'bar': '1.2.3'}).create();
 
       await pubGet();
 
@@ -74,7 +74,7 @@
       expect(await server.peekArchiveChecksumHeader('baz', '1.2.3'),
           'md5=loremipsum');
 
-      await d.appDir({'baz': '1.2.3'}).create();
+      await d.appDir(dependencies: {'baz': '1.2.3'}).create();
 
       await pubGet();
 
@@ -88,7 +88,7 @@
   test('URL encodes the package name', () async {
     await servePackages();
 
-    await d.appDir({'bad name!': '1.2.3'}).create();
+    await d.appDir(dependencies: {'bad name!': '1.2.3'}).create();
 
     await pubGet(
         error: allOf([
@@ -108,7 +108,7 @@
     var server = await startPackageServer();
     server.serve('foo', '1.2.3');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '1.2.3',
         'hosted': {'name': 'foo', 'url': 'http://localhost:${server.port}'}
@@ -131,7 +131,7 @@
       'x-goog-hash': PackageServer.composeChecksumHeader(crc32c: 3381945770)
     });
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '1.2.3',
         'hosted': {'name': 'foo', 'url': 'http://localhost:${server.port}'}
@@ -168,7 +168,7 @@
     });
 
     test('when the CRC32C checksum is empty', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'version': '1.2.3',
           'hosted': {'name': 'foo', 'url': 'http://localhost:${server.port}'}
@@ -188,7 +188,7 @@
     });
 
     test('when the CRC32C checksum has bad encoding', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'bar': {
           'version': '1.2.3',
           'hosted': {'name': 'bar', 'url': 'http://localhost:${server.port}'}
@@ -208,7 +208,7 @@
     });
 
     test('when the CRC32C checksum is malformed', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'baz': {
           'version': '1.2.3',
           'hosted': {'name': 'baz', 'url': 'http://localhost:${server.port}'}
@@ -237,7 +237,7 @@
 
     expect(await server.peekArchiveChecksumHeader('foo', '1.2.3'), isNull);
 
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     await pubGet();
 
@@ -256,7 +256,7 @@
 
     expect(await server.peekArchiveChecksumHeader('foo', '1.2.3'), isNotNull);
 
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     await pubGet();
 
diff --git a/test/get/hosted/get_transitive_test.dart b/test/get/hosted/get_transitive_test.dart
index 0ae18ac..0e51e83 100644
--- a/test/get/hosted/get_transitive_test.dart
+++ b/test/get/hosted/get_transitive_test.dart
@@ -15,7 +15,7 @@
       ..serve('bar', '2.0.4')
       ..serve('bar', '2.0.5');
 
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     await pubGet();
 
diff --git a/test/get/hosted/gets_a_package_with_busted_dev_dependencies_test.dart b/test/get/hosted/gets_a_package_with_busted_dev_dependencies_test.dart
index 585cfba..06bfe3c 100644
--- a/test/get/hosted/gets_a_package_with_busted_dev_dependencies_test.dart
+++ b/test/get/hosted/gets_a_package_with_busted_dev_dependencies_test.dart
@@ -19,7 +19,7 @@
       }
     });
 
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     await pubGet();
 
diff --git a/test/get/hosted/resolve_constraints_test.dart b/test/get/hosted/resolve_constraints_test.dart
index 466902e..6eed388 100644
--- a/test/get/hosted/resolve_constraints_test.dart
+++ b/test/get/hosted/resolve_constraints_test.dart
@@ -16,7 +16,7 @@
       ..serve('baz', '2.0.4')
       ..serve('baz', '3.0.1');
 
-    await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
 
     await pubGet();
 
diff --git a/test/get/hosted/resolve_with_retracted_package_versions_test.dart b/test/get/hosted/resolve_with_retracted_package_versions_test.dart
index d9b33a4..4987cd2 100644
--- a/test/get/hosted/resolve_with_retracted_package_versions_test.dart
+++ b/test/get/hosted/resolve_with_retracted_package_versions_test.dart
@@ -17,7 +17,7 @@
       ..serve('foo', '1.0.0', deps: {'bar': '^1.0.0'})
       ..serve('bar', '1.0.0')
       ..serve('bar', '1.1.0');
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
 
     server.retractPackageVersion('bar', '1.1.0');
     await pubGet();
@@ -33,7 +33,7 @@
     final server = await servePackages()
       ..serve('foo', '1.0.0', deps: {'bar': '^1.0.0'})
       ..serve('bar', '1.0.0');
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
 
     server.retractPackageVersion('bar', '1.0.0');
     await pubGet(
@@ -52,7 +52,7 @@
       ..serve('foo', '1.0.0', deps: {'bar': '^1.0.0'})
       ..serve('bar', '1.0.0')
       ..serve('bar', '1.1.0');
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
 
     await pubGet();
     await d.cacheDir({'foo': '1.0.0', 'bar': '1.1.0'}).validate();
@@ -112,7 +112,7 @@
     // Now serve only errors - to validate we are truly offline.
     server.serveErrors();
 
-    await d.appDir({'foo': '1.0.0', 'bar': '^1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0', 'bar': '^1.0.0'}).create();
 
     await pubUpgrade(args: ['--offline']);
 
@@ -163,7 +163,7 @@
       ..serve('foo', '2.0.0')
       ..serve('foo', '3.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
 
     server.retractPackageVersion('foo', '2.0.0');
diff --git a/test/get/hosted/stay_locked_if_compatible_test.dart b/test/get/hosted/stay_locked_if_compatible_test.dart
index df04579..4adc728 100644
--- a/test/get/hosted/stay_locked_if_compatible_test.dart
+++ b/test/get/hosted/stay_locked_if_compatible_test.dart
@@ -14,7 +14,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet();
     await d.appPackageConfigFile([
@@ -23,7 +23,7 @@
 
     server.serve('foo', '1.0.1');
 
-    await d.appDir({'foo': '>=1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '>=1.0.0'}).create();
 
     await pubGet();
 
diff --git a/test/get/hosted/stay_locked_if_new_is_satisfied_test.dart b/test/get/hosted/stay_locked_if_new_is_satisfied_test.dart
index c75c435..cb431f0 100644
--- a/test/get/hosted/stay_locked_if_new_is_satisfied_test.dart
+++ b/test/get/hosted/stay_locked_if_new_is_satisfied_test.dart
@@ -16,7 +16,7 @@
     server.serve('bar', '1.0.0', deps: {'baz': '<2.0.0'});
     server.serve('baz', '1.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet();
     await d.appPackageConfigFile([
@@ -30,7 +30,7 @@
     server.serve('baz', '2.0.0');
     server.serve('newdep', '2.0.0', deps: {'baz': '>=1.0.0'});
 
-    await d.appDir({'foo': 'any', 'newdep': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'newdep': 'any'}).create();
 
     await pubGet();
 
diff --git a/test/get/hosted/stay_locked_test.dart b/test/get/hosted/stay_locked_test.dart
index 8b819ea..223e06d 100644
--- a/test/get/hosted/stay_locked_test.dart
+++ b/test/get/hosted/stay_locked_test.dart
@@ -16,7 +16,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     // This should lock the foo dependency to version 1.0.0.
     await pubGet();
diff --git a/test/get/hosted/unlock_if_incompatible_test.dart b/test/get/hosted/unlock_if_incompatible_test.dart
index 007231e..a560ea7 100644
--- a/test/get/hosted/unlock_if_incompatible_test.dart
+++ b/test/get/hosted/unlock_if_incompatible_test.dart
@@ -14,7 +14,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet();
 
@@ -22,7 +22,7 @@
       d.packageConfigEntry(name: 'foo', version: '1.0.0'),
     ]).validate();
     server.serve('foo', '1.0.1');
-    await d.appDir({'foo': '>1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '>1.0.0'}).create();
 
     await pubGet();
 
diff --git a/test/get/hosted/unlock_if_new_is_unsatisfied_test.dart b/test/get/hosted/unlock_if_new_is_unsatisfied_test.dart
index ae6a4e6..ce46e2b 100644
--- a/test/get/hosted/unlock_if_new_is_unsatisfied_test.dart
+++ b/test/get/hosted/unlock_if_new_is_unsatisfied_test.dart
@@ -18,7 +18,7 @@
     server.serve('baz', '1.0.0', deps: {'qux': '<2.0.0'});
     server.serve('qux', '1.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet();
 
@@ -35,7 +35,7 @@
     server.serve('qux', '2.0.0');
     server.serve('newdep', '2.0.0', deps: {'baz': '>=1.5.0'});
 
-    await d.appDir({'foo': 'any', 'newdep': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'newdep': 'any'}).create();
 
     await pubGet();
 
diff --git a/test/get/hosted/unlock_if_version_doesnt_exist_test.dart b/test/get/hosted/unlock_if_version_doesnt_exist_test.dart
index e4cc01b..cdb4229 100644
--- a/test/get/hosted/unlock_if_version_doesnt_exist_test.dart
+++ b/test/get/hosted/unlock_if_version_doesnt_exist_test.dart
@@ -15,7 +15,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await pubGet();
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', version: '1.0.0'),
diff --git a/test/get/hosted/warn_about_discontinued_test.dart b/test/get/hosted/warn_about_discontinued_test.dart
index e885f35..aaa6754 100644
--- a/test/get/hosted/warn_about_discontinued_test.dart
+++ b/test/get/hosted/warn_about_discontinued_test.dart
@@ -17,7 +17,7 @@
     final server = await servePackages();
     server.serve('foo', '1.2.3', deps: {'transitive': 'any'});
     server.serve('transitive', '1.0.0');
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
     await pubGet();
 
     server
@@ -157,7 +157,7 @@
   test('get does not fail when status listing fails', () async {
     final server = await servePackages();
     server.serve('foo', '1.2.3');
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
     await pubGet();
     final fooVersionsCache =
         p.join(globalServer.cachingPath, '.cache', 'foo-versions.json');
diff --git a/test/get/hosted/warn_about_retracted_package_test.dart b/test/get/hosted/warn_about_retracted_package_test.dart
index 2336c7f..74652da 100644
--- a/test/get/hosted/warn_about_retracted_package_test.dart
+++ b/test/get/hosted/warn_about_retracted_package_test.dart
@@ -14,7 +14,7 @@
     final server = await servePackages()
       ..serve('foo', '1.0.0', deps: {'bar': 'any'})
       ..serve('bar', '1.0.0');
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
 
     await pubGet();
 
@@ -33,7 +33,7 @@
       ..serve('bar', '1.0.0')
       ..serve('bar', '2.0.0')
       ..serve('bar', '2.0.1-pre');
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
 
     await pubGet();
 
@@ -52,7 +52,7 @@
       ..serve('foo', '1.0.0', deps: {'bar': '^1.0.0-pre'})
       ..serve('bar', '1.0.0-pre')
       ..serve('bar', '2.0.1-pre');
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
 
     await pubGet();
 
diff --git a/test/get/path/absolute_path_test.dart b/test/get/path/absolute_path_test.dart
index e1897e9..8bc3331 100644
--- a/test/get/path/absolute_path_test.dart
+++ b/test/get/path/absolute_path_test.dart
@@ -14,7 +14,7 @@
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': path.join(d.sandbox, 'foo')}
       })
     ]).create();
diff --git a/test/get/path/absolute_symlink_test.dart b/test/get/path/absolute_symlink_test.dart
index 83d3433..9fec979 100644
--- a/test/get/path/absolute_symlink_test.dart
+++ b/test/get/path/absolute_symlink_test.dart
@@ -17,7 +17,7 @@
 
     var fooPath = d.path('foo');
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': fooPath}
       })
     ]).create();
diff --git a/test/get/path/empty_pubspec_test.dart b/test/get/path/empty_pubspec_test.dart
index 0f9843f..e3ddaf9 100644
--- a/test/get/path/empty_pubspec_test.dart
+++ b/test/get/path/empty_pubspec_test.dart
@@ -15,7 +15,7 @@
     await d.dir('foo', [d.libDir('foo'), d.file('pubspec.yaml', '')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
diff --git a/test/get/path/no_pubspec_test.dart b/test/get/path/no_pubspec_test.dart
index d328f25..aa0c872 100644
--- a/test/get/path/no_pubspec_test.dart
+++ b/test/get/path/no_pubspec_test.dart
@@ -16,7 +16,7 @@
     var fooPath = path.join(d.sandbox, 'foo');
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': fooPath}
       })
     ]).create();
diff --git a/test/get/path/nonexistent_dir_test.dart b/test/get/path/nonexistent_dir_test.dart
index 7616087..511f066 100644
--- a/test/get/path/nonexistent_dir_test.dart
+++ b/test/get/path/nonexistent_dir_test.dart
@@ -14,7 +14,7 @@
     var badPath = path.join(d.sandbox, 'bad_path');
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': badPath}
       })
     ]).create();
diff --git a/test/get/path/path_is_file_test.dart b/test/get/path/path_is_file_test.dart
index 6fafd82..ffeeef0 100644
--- a/test/get/path/path_is_file_test.dart
+++ b/test/get/path/path_is_file_test.dart
@@ -17,7 +17,7 @@
     var dummyPath = path.join(d.sandbox, 'dummy.txt');
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': dummyPath}
       })
     ]).create();
diff --git a/test/get/path/relative_path_test.dart b/test/get/path/relative_path_test.dart
index 3a7fb8f..64c8b21 100644
--- a/test/get/path/relative_path_test.dart
+++ b/test/get/path/relative_path_test.dart
@@ -20,7 +20,7 @@
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
@@ -44,7 +44,7 @@
     ]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../relative/foo'}
       })
     ]).create();
@@ -70,7 +70,7 @@
     ]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../relative/foo'}
       })
     ]).create();
@@ -91,7 +91,7 @@
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
diff --git a/test/get/path/relative_symlink_test.dart b/test/get/path/relative_symlink_test.dart
index 9136a34..95ffc54 100644
--- a/test/get/path/relative_symlink_test.dart
+++ b/test/get/path/relative_symlink_test.dart
@@ -21,7 +21,7 @@
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
diff --git a/test/get/path/shared_dependency_symlink_test.dart b/test/get/path/shared_dependency_symlink_test.dart
index d450838..f87de46 100644
--- a/test/get/path/shared_dependency_symlink_test.dart
+++ b/test/get/path/shared_dependency_symlink_test.dart
@@ -29,7 +29,7 @@
     ]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'bar': {'path': '../bar'},
         'foo': {'path': '../foo'},
       })
diff --git a/test/get/path/shared_dependency_test.dart b/test/get/path/shared_dependency_test.dart
index 3ef91ae..df8f78c 100644
--- a/test/get/path/shared_dependency_test.dart
+++ b/test/get/path/shared_dependency_test.dart
@@ -27,7 +27,7 @@
     ]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'},
         'bar': {'path': '../bar'}
       })
@@ -61,7 +61,7 @@
     ]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'},
         'bar': {'path': '../bar'}
       })
diff --git a/test/get/summary_only_environment_test.dart b/test/get/summary_only_environment_test.dart
index 3f16fc6..a4adb50 100644
--- a/test/get/summary_only_environment_test.dart
+++ b/test/get/summary_only_environment_test.dart
@@ -10,7 +10,7 @@
 void main() {
   test('pub get with PUB_SUMMARY_ONLY will only print a summary', () async {
     (await servePackages()).serve('foo', '1.0.0');
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet(
       output: 'Resolving dependencies...\nGot dependencies.',
diff --git a/test/get/switch_source_test.dart b/test/get/switch_source_test.dart
index 7e56652..a8a8863 100644
--- a/test/get/switch_source_test.dart
+++ b/test/get/switch_source_test.dart
@@ -15,7 +15,7 @@
     await d.dir('foo',
         [d.libDir('foo', 'foo 0.0.1'), d.libPubspec('foo', '0.0.1')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'path': '../foo'}
     }).create();
 
@@ -24,7 +24,7 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'foo', path: '../foo'),
     ]).validate();
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet();
 
diff --git a/test/get/with_empty_environment_test.dart b/test/get/with_empty_environment_test.dart
index 5dab9b3..a3b64d3 100644
--- a/test/get/with_empty_environment_test.dart
+++ b/test/get/with_empty_environment_test.dart
@@ -12,7 +12,7 @@
     final server = await servePackages();
     server.serve('foo', '1.2.3');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet(environment: {
       '_PUB_TEST_CONFIG_DIR': null,
diff --git a/test/global/run/package_api_test.dart b/test/global/run/package_api_test.dart
index 5db401b..f38360c 100644
--- a/test/global/run/package_api_test.dart
+++ b/test/global/run/package_api_test.dart
@@ -56,7 +56,7 @@
     await d.dir('foo', [d.libPubspec('foo', '1.0.0')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       }),
       d.dir('bin', [
diff --git a/test/hosted/fail_gracefully_on_bad_version_listing_response_test.dart b/test/hosted/fail_gracefully_on_bad_version_listing_response_test.dart
index 7fb22a3..f79ced4 100644
--- a/test/hosted/fail_gracefully_on_bad_version_listing_response_test.dart
+++ b/test/hosted/fail_gracefully_on_bad_version_listing_response_test.dart
@@ -29,7 +29,7 @@
               }));
         }),
       );
-      await d.appDir({'foo': '1.2.3'}).create();
+      await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
       await pubCommand(command,
           error: allOf([
@@ -50,7 +50,7 @@
             'notTheRight': {'response': 'type'}
           }));
     });
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     await ctx.run(['get']);
   });
@@ -64,7 +64,7 @@
             'notTheRight': {'response': 'type'}
           }));
     });
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     await ctx.run(['get']);
   });
@@ -78,7 +78,7 @@
             'notTheRight': {'response': 'type'}
           }));
     });
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     await ctx.run(['get']);
   });
@@ -95,7 +95,7 @@
             'notTheRight': {'response': 'type'}
           }));
     });
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     await ctx.run(['get']);
   });
@@ -112,7 +112,7 @@
             'notTheRight': {'response': 'type'}
           }));
     });
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
     await ctx.run(['get']);
   });
diff --git a/test/hosted/fail_gracefully_on_invalid_url_test.dart b/test/hosted/fail_gracefully_on_invalid_url_test.dart
index 94922c0..c3a1e9f 100644
--- a/test/hosted/fail_gracefully_on_invalid_url_test.dart
+++ b/test/hosted/fail_gracefully_on_invalid_url_test.dart
@@ -12,7 +12,7 @@
   forBothPubGetAndUpgrade((command) {
     test('fails gracefully if the url is invalid', () async {
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': 'not@url-com'}
           }
@@ -30,7 +30,7 @@
     });
     test('fails gracefully if the url has querystring', () async {
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': 'http://example.foo/?key=value'}
           }
@@ -49,7 +49,7 @@
 
     test('fails gracefully if the url has fragment', () async {
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': 'http://example.foo/#hash'}
           }
@@ -68,7 +68,7 @@
 
     test('fails gracefully if the url has user-info (1)', () async {
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': 'http://user:pwd@example.foo/'}
           }
@@ -87,7 +87,7 @@
 
     test('fails gracefully if the url has user-info (2)', () async {
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': 'http://user@example.foo/'}
           }
diff --git a/test/hosted/fail_gracefully_on_missing_package_test.dart b/test/hosted/fail_gracefully_on_missing_package_test.dart
index 66db87f..7371a1b 100644
--- a/test/hosted/fail_gracefully_on_missing_package_test.dart
+++ b/test/hosted/fail_gracefully_on_missing_package_test.dart
@@ -13,7 +13,7 @@
     test('fails gracefully if the package does not exist', () async {
       await servePackages();
 
-      await d.appDir({'foo': '1.2.3'}).create();
+      await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
       await pubCommand(command,
           error: allOf([
@@ -32,7 +32,7 @@
       final server = await servePackages();
       server.serve('foo', '1.2.3', deps: {'bar': '^1.0.0'});
 
-      await d.appDir({'foo': '1.2.3'}).create();
+      await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
       await pubCommand(command,
           error: allOf(
diff --git a/test/hosted/fail_gracefully_on_url_resolve_test.dart b/test/hosted/fail_gracefully_on_url_resolve_test.dart
index 0dff951..56ae5e9 100644
--- a/test/hosted/fail_gracefully_on_url_resolve_test.dart
+++ b/test/hosted/fail_gracefully_on_url_resolve_test.dart
@@ -12,7 +12,7 @@
   forBothPubGetAndUpgrade((command) {
     test('fails gracefully if the url does not resolve', () async {
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': 'https://invalid-url.foo'}
           }
diff --git a/test/hosted/fail_gracefully_with_hint_test.dart b/test/hosted/fail_gracefully_with_hint_test.dart
index 4f1a326..7d95695 100644
--- a/test/hosted/fail_gracefully_with_hint_test.dart
+++ b/test/hosted/fail_gracefully_with_hint_test.dart
@@ -14,7 +14,7 @@
     // Run the server so that we know what URL to use in the system cache.
     (await servePackages()).serveErrors();
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet(
       args: ['--offline'],
@@ -48,7 +48,7 @@
       ]),
     ]).create();
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet(
       args: ['--offline'],
diff --git a/test/hosted/metadata_test.dart b/test/hosted/metadata_test.dart
index c705ac7..554d274 100644
--- a/test/hosted/metadata_test.dart
+++ b/test/hosted/metadata_test.dart
@@ -15,7 +15,7 @@
       final server = await servePackages();
       server.serve('foo', '1.0.0');
 
-      await d.appDir({'foo': '1.0.0'}).create();
+      await d.appDir(dependencies: {'foo': '1.0.0'}).create();
 
       await pubCommand(command,
           silent: allOf([
@@ -60,7 +60,7 @@
       final server = await servePackages();
       server.serve('bar', '1.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {'path': '../foo'}
       }).create();
 
@@ -82,7 +82,7 @@
       var server = await startPackageServer()
         ..serve('foo', '1.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'version': '1.0.0',
           'hosted': {'name': 'foo', 'url': 'http://localhost:${server.port}'}
@@ -95,7 +95,7 @@
     test("doesn't send metadata headers when CI=true", () async {
       (await servePackages()).serve('foo', '1.0.0');
 
-      await d.appDir({'foo': '1.0.0'}).create();
+      await d.appDir(dependencies: {'foo': '1.0.0'}).create();
 
       await pubCommand(command,
           silent: isNot(contains('X-Pub-')),
diff --git a/test/hosted/offline_test.dart b/test/hosted/offline_test.dart
index ca3dc80..d5518bb 100644
--- a/test/hosted/offline_test.dart
+++ b/test/hosted/offline_test.dart
@@ -17,7 +17,7 @@
   }
   for (final entry in versions.entries) {
     for (final version in entry.value) {
-      await d.appDir({entry.key: version}).create();
+      await d.appDir(dependencies: {entry.key: version}).create();
       await pubGet();
     }
   }
@@ -35,7 +35,7 @@
       // Now serve only errors - to validate we are truly offline.
       server.serveErrors();
 
-      await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
 
       String? warning;
       if (command == RunCommand.upgrade) {
@@ -58,7 +58,7 @@
       // Now serve only errors - to validate we are truly offline.
       server.serveErrors();
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
 
       String? warning;
       if (command == RunCommand.upgrade) {
@@ -78,7 +78,7 @@
       final server = await servePackages();
       server.serveErrors();
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
 
       await pubCommand(command,
           args: ['--offline'],
@@ -100,7 +100,7 @@
       // Run the server so that we know what URL to use in the system cache.
       server.serveErrors();
 
-      await d.appDir({'foo': '>2.0.0'}).create();
+      await d.appDir(dependencies: {'foo': '>2.0.0'}).create();
 
       await pubCommand(command,
           args: ['--offline'], error: equalsIgnoringWhitespace("""
@@ -117,7 +117,7 @@
       // Run the server so that we know what URL to use in the system cache.
       server.serveErrors();
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
 
       await createLockFile('myapp', hosted: {'foo': '1.2.4'});
 
@@ -141,7 +141,7 @@
       // Run the server so that we know what URL to use in the system cache.
       server.serveErrors();
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
 
       await createLockFile('myapp', hosted: {'foo': '1.2.4'});
 
@@ -166,7 +166,7 @@
         d.file('random_filename', ''),
       ]).create();
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
 
       await pubCommand(command, args: ['--offline']);
 
@@ -188,7 +188,7 @@
         d.dir('foo-1.2.3', [d.file('pubspec.yaml', '{')])
       ]).create();
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
 
       await createLockFile('myapp', hosted: {'foo': '1.2.3'});
 
diff --git a/test/hosted/remove_removed_dependency_test.dart b/test/hosted/remove_removed_dependency_test.dart
index a0446c0..cabf3f2 100644
--- a/test/hosted/remove_removed_dependency_test.dart
+++ b/test/hosted/remove_removed_dependency_test.dart
@@ -14,7 +14,7 @@
         ..serve('foo', '1.0.0')
         ..serve('bar', '1.0.0');
 
-      await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
 
       await pubCommand(command);
       await d.appPackageConfigFile([
@@ -22,7 +22,7 @@
         d.packageConfigEntry(name: 'bar', version: '1.0.0'),
       ]).validate();
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
 
       await pubCommand(command);
 
diff --git a/test/hosted/remove_removed_transitive_dependency_test.dart b/test/hosted/remove_removed_transitive_dependency_test.dart
index 182ec3f..3f0c5d5 100644
--- a/test/hosted/remove_removed_transitive_dependency_test.dart
+++ b/test/hosted/remove_removed_transitive_dependency_test.dart
@@ -18,7 +18,7 @@
         ..serve('shared_dep', '1.0.0')
         ..serve('bar_dep', '1.0.0');
 
-      await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
 
       await pubCommand(command);
       await d.appPackageConfigFile([
@@ -28,7 +28,7 @@
         d.packageConfigEntry(name: 'bar_dep', version: '1.0.0'),
       ]).validate();
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
 
       await pubCommand(command);
 
diff --git a/test/hosted/version_negotiation_test.dart b/test/hosted/version_negotiation_test.dart
index 8436a1c..c6fcc11 100644
--- a/test/hosted/version_negotiation_test.dart
+++ b/test/hosted/version_negotiation_test.dart
@@ -14,7 +14,7 @@
     test('sends the correct Accept header', () async {
       await servePackages();
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'hosted': {'name': 'foo', 'url': globalServer.url}
         }
@@ -33,7 +33,7 @@
     test('prints a friendly error if the version is out-of-date', () async {
       await servePackages();
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'hosted': {'name': 'foo', 'url': globalServer.url}
         }
diff --git a/test/hosted/will_normalize_hosted_url_test.dart b/test/hosted/will_normalize_hosted_url_test.dart
index 904d3d8..73c642b 100644
--- a/test/hosted/will_normalize_hosted_url_test.dart
+++ b/test/hosted/will_normalize_hosted_url_test.dart
@@ -22,7 +22,7 @@
       expect(Uri.parse(globalServer.url).path, isEmpty);
 
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': globalServer.url},
           },
@@ -40,7 +40,7 @@
       server.serve('foo', '1.2.3');
 
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': '${globalServer.url}/'},
           },
@@ -63,7 +63,7 @@
       );
 
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': '${globalServer.url}//'},
           },
@@ -109,7 +109,7 @@
       final normalizedUrl = '${globalServer.url}/my-folder/';
 
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': testUrl},
           },
@@ -133,7 +133,7 @@
       final normalizedUrl = '${globalServer.url}/my-folder/';
 
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {
             'hosted': {'name': 'foo', 'url': testUrl},
           },
diff --git a/test/lish/requires_resolution_before_publishing_test.dart b/test/lish/requires_resolution_before_publishing_test.dart
index e3294bc..3dfebc0 100644
--- a/test/lish/requires_resolution_before_publishing_test.dart
+++ b/test/lish/requires_resolution_before_publishing_test.dart
@@ -12,7 +12,7 @@
   test('does not publish if no resolution can be found', () async {
     await servePackages(); // No packages.
     await d.validPackage.create();
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await runPub(
       args: ['lish'],
       error: contains("Because myapp depends on foo any which doesn't exist"),
diff --git a/test/list_package_dirs/ignores_updated_pubspec_test.dart b/test/list_package_dirs/ignores_updated_pubspec_test.dart
index 2524681..10ff0da 100644
--- a/test/list_package_dirs/ignores_updated_pubspec_test.dart
+++ b/test/list_package_dirs/ignores_updated_pubspec_test.dart
@@ -16,7 +16,7 @@
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': path.join(d.sandbox, 'foo')}
       })
     ]).create();
@@ -25,7 +25,7 @@
     // Add a dependency on "bar" and remove "foo", but don't run "pub get".
 
     await d.dir(appPath, [
-      d.appPubspec({'bar': 'any'})
+      d.appPubspec(dependencies: {'bar': 'any'})
     ]).create();
     // Note: Using canonicalize here because pub gets the path to the
     // entrypoint package from the working directory, which has had symlinks
diff --git a/test/list_package_dirs/lists_dependency_directories_test.dart b/test/list_package_dirs/lists_dependency_directories_test.dart
index 2cd9664..7cd4fb7 100644
--- a/test/list_package_dirs/lists_dependency_directories_test.dart
+++ b/test/list_package_dirs/lists_dependency_directories_test.dart
@@ -19,7 +19,7 @@
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': path.join(d.sandbox, 'foo')},
         'bar': 'any'
       })
diff --git a/test/must_pub_get_test.dart b/test/must_pub_get_test.dart
index f4e0777..b692202 100644
--- a/test/must_pub_get_test.dart
+++ b/test/must_pub_get_test.dart
@@ -39,7 +39,7 @@
       d.pubspec({'name': 'bar'})
     ]).create();
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'bar': {'path': '../bar'}
       })
     ]).create();
@@ -82,7 +82,7 @@
         await d.dir('foo', [d.libPubspec('foo', '1.0.0')]).create();
 
         await d.dir(appPath, [
-          d.appPubspec({
+          d.appPubspec(dependencies: {
             'foo': {'path': '../foo'}
           })
         ]).create();
@@ -98,7 +98,7 @@
     group('the lockfile has a dependency from the wrong source', () {
       setUp(() async {
         await d.dir(appPath, [
-          d.appPubspec({'foo': '1.0.0'})
+          d.appPubspec(dependencies: {'foo': '1.0.0'})
         ]).create();
 
         await pubGet();
@@ -116,7 +116,7 @@
     group('the lockfile has a dependency from an unknown source', () {
       setUp(() async {
         await d.dir(appPath, [
-          d.appPubspec({'foo': '1.0.0'})
+          d.appPubspec(dependencies: {'foo': '1.0.0'})
         ]).create();
 
         await pubGet();
@@ -148,7 +148,7 @@
         await d.dir('bar', [d.libPubspec('foo', '1.0.0')]).create();
 
         await d.dir(appPath, [
-          d.appPubspec({
+          d.appPubspec(dependencies: {
             'foo': {'path': '../bar'}
           })
         ]).create();
@@ -168,13 +168,13 @@
     group('the pubspec has an incompatible version of a dependency', () {
       setUp(() async {
         await d.dir(appPath, [
-          d.appPubspec({'foo': '1.0.0'})
+          d.appPubspec(dependencies: {'foo': '1.0.0'})
         ]).create();
 
         await pubGet();
 
         await d.dir(appPath, [
-          d.appPubspec({'foo': '2.0.0'})
+          d.appPubspec(dependencies: {'foo': '2.0.0'})
         ]).create();
 
         // Ensure that the pubspec looks newer than the lockfile.
@@ -190,7 +190,7 @@
         'pubspec', () {
       setUp(() async {
         await d.dir(appPath, [
-          d.appPubspec({'foo': '1.0.0'})
+          d.appPubspec(dependencies: {'foo': '1.0.0'})
         ]).create();
 
         await pubGet();
@@ -210,7 +210,7 @@
         await d.dir('bar', [d.libPubspec('foo', '1.0.0')]).create();
 
         await d.dir(appPath, [
-          d.appPubspec({
+          d.appPubspec(dependencies: {
             'foo': {'path': '../bar'}
           })
         ]).create();
@@ -279,7 +279,7 @@
       await d.dir('flutter', [d.file('version', '1.2.3')]).create();
 
       await d.dir(appPath, [
-        d.appPubspec({'foo': '3.0.0'})
+        d.appPubspec(dependencies: {'foo': '3.0.0'})
       ]).create();
 
       await pubGet(environment: {'FLUTTER_ROOT': p.join(d.sandbox, 'flutter')});
@@ -303,7 +303,7 @@
         ]).create();
 
         await d.dir(appPath, [
-          d.appPubspec({
+          d.appPubspec(dependencies: {
             'bar': {'path': '../bar'}
           })
         ]).create();
@@ -336,7 +336,7 @@
         ]).create();
 
         await d.dir(appPath, [
-          d.appPubspec({
+          d.appPubspec(dependencies: {
             'bar': {'path': '../bar'}
           })
         ]).create();
@@ -367,7 +367,7 @@
         'package-config, even if the contents are wrong', () {
       setUp(() async {
         await d.dir(appPath, [
-          d.appPubspec({'foo': '1.0.0'})
+          d.appPubspec(dependencies: {'foo': '1.0.0'})
         ]).create();
         // Ensure we get a new mtime (mtime is only reported with 1s precision)
         await _touch('pubspec.yaml');
@@ -382,7 +382,7 @@
     group("the pubspec is newer than the lockfile, but they're up-to-date", () {
       setUp(() async {
         await d.dir(appPath, [
-          d.appPubspec({'foo': '1.0.0'})
+          d.appPubspec(dependencies: {'foo': '1.0.0'})
         ]).create();
 
         await pubGet();
@@ -401,7 +401,7 @@
         ]).create();
 
         await d.dir(appPath, [
-          d.appPubspec({
+          d.appPubspec(dependencies: {
             'foo': {'path': '../foo'}
           })
         ]).create();
@@ -418,7 +418,7 @@
         () {
       setUp(() async {
         await d.dir(appPath, [
-          d.appPubspec({'foo': '1.0.0'})
+          d.appPubspec(dependencies: {'foo': '1.0.0'})
         ]).create();
 
         await pubGet();
@@ -464,7 +464,7 @@
       await d.dir('flutter', [d.file('version', '1.2.3')]).create();
 
       await d.dir(appPath, [
-        d.appPubspec({'foo': '3.0.0'})
+        d.appPubspec(dependencies: {'foo': '3.0.0'})
       ]).create();
 
       await pubGet(environment: {'FLUTTER_ROOT': p.join(d.sandbox, 'flutter')});
diff --git a/test/outdated/outdated_test.dart b/test/outdated/outdated_test.dart
index d2476dd..8e03ce0 100644
--- a/test/outdated/outdated_test.dart
+++ b/test/outdated/outdated_test.dart
@@ -44,7 +44,7 @@
   });
 
   testWithGolden('no lockfile', (ctx) async {
-    await d.appDir({'foo': '^1.0.0', 'bar': '^1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '^1.0.0', 'bar': '^1.0.0'}).create();
     await servePackages()
       ..serve('foo', '1.2.3')
       ..serve('bar', '1.2.3')
diff --git a/test/package_config_file_test.dart b/test/package_config_file_test.dart
index f31769f..0bdb2d3 100644
--- a/test/package_config_file_test.dart
+++ b/test/package_config_file_test.dart
@@ -20,7 +20,7 @@
             deps: {'bar': '3.2.1'}, contents: [d.dir('lib', [])]);
 
       await d.dir(appPath, [
-        d.appPubspec({'foo': '1.2.3'}),
+        d.appPubspec(dependencies: {'foo': '1.2.3'}),
         d.dir('lib')
       ]).create();
 
@@ -61,7 +61,7 @@
             deps: {'bar': '3.2.1'}, contents: [d.dir('lib', [])]);
 
       await d.dir(appPath, [
-        d.appPubspec({'foo': '1.2.3'}),
+        d.appPubspec(dependencies: {'foo': '1.2.3'}),
         d.dir('lib')
       ]).create();
 
@@ -107,7 +107,7 @@
 
     test('package_config.json file is not created if pub fails', () async {
       await d.dir(appPath, [
-        d.appPubspec({'foo': '1.2.3'}),
+        d.appPubspec(dependencies: {'foo': '1.2.3'}),
         d.dir('lib')
       ]).create();
 
diff --git a/test/pub_get_and_upgrade_test.dart b/test/pub_get_and_upgrade_test.dart
index f64f93b..0336552 100644
--- a/test/pub_get_and_upgrade_test.dart
+++ b/test/pub_get_and_upgrade_test.dart
@@ -75,7 +75,7 @@
       ]).create();
 
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {'path': '../deps/foo'},
           'bar': {'path': '../deps/bar'}
         })
@@ -87,7 +87,7 @@
 
     test('does not allow a dependency on itself', () async {
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'myapp': {'path': '.'}
         })
       ]).create();
diff --git a/test/pubspec_overrides_test.dart b/test/pubspec_overrides_test.dart
index 88e22aa..7e0547c 100644
--- a/test/pubspec_overrides_test.dart
+++ b/test/pubspec_overrides_test.dart
@@ -15,7 +15,7 @@
         ..serve('lib', '2.0.0');
 
       await d.dir(appPath, [
-        d.appPubspec({'lib': '1.0.0'}),
+        d.appPubspec(dependencies: {'lib': '1.0.0'}),
         d.dir('lib'),
         d.pubspecOverrides({
           'dependency_overrides': {'lib': '2.0.0'}
diff --git a/test/remove/remove_test.dart b/test/remove/remove_test.dart
index 1307633..f331ac6 100644
--- a/test/remove/remove_test.dart
+++ b/test/remove/remove_test.dart
@@ -15,7 +15,7 @@
     final server = await servePackages();
     server.serve('foo', '1.2.3');
 
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
     await pubGet();
 
     await pubRemove(args: ['foo']);
@@ -65,7 +65,7 @@
     final server = await servePackages();
     server.serve('foo', '1.2.3');
 
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
     await pubGet();
 
     await pubRemove(
@@ -75,7 +75,7 @@
           contains('- foo 1.2.3')
         ]));
 
-    await d.appDir({'foo': '1.2.3'}).validate();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).validate();
   });
 
   test('prints a warning if package does not exist', () async {
@@ -165,7 +165,7 @@
     ]);
     await repo.create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'git': {'url': '../foo.git', 'path': 'subdir'}
       },
@@ -179,7 +179,7 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'bar', version: '1.2.3'),
     ]).validate();
-    await d.appDir({'bar': '1.2.3'}).validate();
+    await d.appDir(dependencies: {'bar': '1.2.3'}).validate();
   });
 
   test('removes path dependencies', () async {
@@ -188,7 +188,7 @@
     await d
         .dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'path': '../foo'},
       'bar': '1.2.3'
     }).create();
@@ -199,7 +199,7 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'bar', version: '1.2.3'),
     ]).validate();
-    await d.appDir({'bar': '1.2.3'}).validate();
+    await d.appDir(dependencies: {'bar': '1.2.3'}).validate();
   });
 
   test('removes hosted dependencies', () async {
@@ -209,7 +209,7 @@
     var custom = await startPackageServer();
     custom.serve('foo', '1.2.3');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '1.2.3',
         'hosted': {'name': 'foo', 'url': 'http://localhost:${custom.port}'}
@@ -223,7 +223,7 @@
     await d.appPackageConfigFile([
       d.packageConfigEntry(name: 'bar', version: '2.0.1'),
     ]).validate();
-    await d.appDir({'bar': '2.0.1'}).validate();
+    await d.appDir(dependencies: {'bar': '2.0.1'}).validate();
   });
 
   test('preserves comments', () async {
@@ -249,7 +249,7 @@
 
     await pubRemove(args: ['bar']);
 
-    await d.appDir({'foo': '1.0.0'}).validate();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).validate();
     final fullPath = p.join(d.sandbox, appPath, 'pubspec.yaml');
     expect(File(fullPath).existsSync(), true);
     final contents = File(fullPath).readAsStringSync();
diff --git a/test/run/errors_if_only_transitive_dependency_test.dart b/test/run/errors_if_only_transitive_dependency_test.dart
index 71fcd3d..ac4dcc4 100644
--- a/test/run/errors_if_only_transitive_dependency_test.dart
+++ b/test/run/errors_if_only_transitive_dependency_test.dart
@@ -22,7 +22,7 @@
     ]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'bar': {'path': '../bar'}
       })
     ]).create();
diff --git a/test/run/errors_if_path_in_dependency_test.dart b/test/run/errors_if_path_in_dependency_test.dart
index 329650b..e1c243d 100644
--- a/test/run/errors_if_path_in_dependency_test.dart
+++ b/test/run/errors_if_path_in_dependency_test.dart
@@ -15,7 +15,7 @@
     await d.dir('foo', [d.libPubspec('foo', '1.0.0')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
diff --git a/test/run/loads_package_imports_in_a_dependency_test.dart b/test/run/loads_package_imports_in_a_dependency_test.dart
index 7bfb047..1b5a7b9 100644
--- a/test/run/loads_package_imports_in_a_dependency_test.dart
+++ b/test/run/loads_package_imports_in_a_dependency_test.dart
@@ -22,7 +22,7 @@
     ]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
diff --git a/test/run/nonexistent_script_in_dependency_test.dart b/test/run/nonexistent_script_in_dependency_test.dart
index 62816df..585b159 100644
--- a/test/run/nonexistent_script_in_dependency_test.dart
+++ b/test/run/nonexistent_script_in_dependency_test.dart
@@ -14,7 +14,7 @@
     await d.dir('foo', [d.libPubspec('foo', '1.0.0')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
diff --git a/test/run/package_api_test.dart b/test/run/package_api_test.dart
index 4d05408..c7d0d2d 100644
--- a/test/run/package_api_test.dart
+++ b/test/run/package_api_test.dart
@@ -26,7 +26,7 @@
     await d.dir('foo', [d.libPubspec('foo', '1.0.0')]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       }),
       d.dir('bin', [d.file('script.dart', _script)])
@@ -55,7 +55,7 @@
     ]);
 
     await d.dir(appPath, [
-      d.appPubspec({'foo': 'any'})
+      d.appPubspec(dependencies: {'foo': 'any'})
     ]).create();
 
     await pubGet();
diff --git a/test/run/precompile_test.dart b/test/run/precompile_test.dart
index 2d70b4c..80ce50b 100644
--- a/test/run/precompile_test.dart
+++ b/test/run/precompile_test.dart
@@ -18,7 +18,7 @@
 void main() {
   Future<void> setupForPubRunToPrecompile() async {
     await d.dir(appPath, [
-      d.appPubspec({'test': '1.0.0'}),
+      d.appPubspec(dependencies: {'test': '1.0.0'}),
     ]).create();
 
     final server = await servePackages();
@@ -54,7 +54,7 @@
   // Regression test of https://github.com/dart-lang/pub/issues/2483
   test('`pub run` precompiles script with relative PUB_CACHE', () async {
     await d.dir(appPath, [
-      d.appPubspec({'test': '1.0.0'}),
+      d.appPubspec(dependencies: {'test': '1.0.0'}),
     ]).create();
 
     final server = await servePackages();
@@ -77,7 +77,7 @@
 
   test('`get --precompile` precompiles script', () async {
     await d.dir(appPath, [
-      d.appPubspec({'test': '1.0.0'}),
+      d.appPubspec(dependencies: {'test': '1.0.0'}),
     ]).create();
 
     final server = await servePackages();
@@ -101,7 +101,7 @@
   test('`get --precompile` precompiles script with relative PUB_CACHE',
       () async {
     await d.dir(appPath, [
-      d.appPubspec({'test': '1.0.0'}),
+      d.appPubspec(dependencies: {'test': '1.0.0'}),
     ]).create();
 
     final server = await servePackages();
diff --git a/test/run/runs_from_a_dependency_override_after_dependency_test.dart b/test/run/runs_from_a_dependency_override_after_dependency_test.dart
index c11bacb..7228d71 100644
--- a/test/run/runs_from_a_dependency_override_after_dependency_test.dart
+++ b/test/run/runs_from_a_dependency_override_after_dependency_test.dart
@@ -19,7 +19,7 @@
     ]);
 
     await d.dir(appPath, [
-      d.appPubspec({'foo': null})
+      d.appPubspec(dependencies: {'foo': null})
     ]).create();
 
     await pubGet(args: ['--precompile']);
diff --git a/test/run/runs_named_app_in_dependency_test.dart b/test/run/runs_named_app_in_dependency_test.dart
index 8f3d73d..046bd9c 100644
--- a/test/run/runs_named_app_in_dependency_test.dart
+++ b/test/run/runs_named_app_in_dependency_test.dart
@@ -15,7 +15,7 @@
     ]).create();
 
     await d.dir(appPath, [
-      d.appPubspec({
+      d.appPubspec(dependencies: {
         'foo': {'path': '../foo'}
       })
     ]).create();
diff --git a/test/sdk_test.dart b/test/sdk_test.dart
index 6165cd5..ec1d405 100644
--- a/test/sdk_test.dart
+++ b/test/sdk_test.dart
@@ -32,7 +32,7 @@
     });
 
     test("gets an SDK dependency's dependencies", () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {'sdk': 'flutter'}
       }).create();
       await pubCommand(command,
@@ -45,7 +45,7 @@
     });
 
     test('gets an SDK dependency from bin/cache/pkg', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'baz': {'sdk': 'flutter'}
       }).create();
       await pubCommand(command,
@@ -59,7 +59,7 @@
     });
 
     test('unlocks an SDK dependency when the version changes', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {'sdk': 'flutter'}
       }).create();
       await pubCommand(command,
@@ -94,7 +94,7 @@
 
     group('fails if', () {
       test("the version constraint doesn't match", () async {
-        await d.appDir({
+        await d.appDir(dependencies: {
           'foo': {'sdk': 'flutter', 'version': '^1.0.0'}
         }).create();
         await pubCommand(command,
@@ -106,7 +106,7 @@
       });
 
       test('the SDK is unknown', () async {
-        await d.appDir({
+        await d.appDir(dependencies: {
           'foo': {'sdk': 'unknown'}
         }).create();
         await pubCommand(command, error: equalsIgnoringWhitespace("""
@@ -116,7 +116,7 @@
       });
 
       test('the SDK is unavailable', () async {
-        await d.appDir({
+        await d.appDir(dependencies: {
           'foo': {'sdk': 'flutter'}
         }).create();
         await pubCommand(command, error: equalsIgnoringWhitespace("""
@@ -129,7 +129,7 @@
       });
 
       test("the SDK doesn't contain the package", () async {
-        await d.appDir({
+        await d.appDir(dependencies: {
           'bar': {'sdk': 'flutter'}
         }).create();
         await pubCommand(command,
@@ -143,7 +143,7 @@
       });
 
       test("the Dart SDK doesn't contain the package", () async {
-        await d.appDir({
+        await d.appDir(dependencies: {
           'bar': {'sdk': 'dart'}
         }).create();
         await pubCommand(command, error: equalsIgnoringWhitespace("""
@@ -157,7 +157,7 @@
     test('supports the Fuchsia SDK', () async {
       renameDir(p.join(d.sandbox, 'flutter'), p.join(d.sandbox, 'fuchsia'));
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {'sdk': 'fuchsia'}
       }).create();
       await pubCommand(command,
diff --git a/test/snapshot_test.dart b/test/snapshot_test.dart
index 8143f7e..f780fa6 100644
--- a/test/snapshot_test.dart
+++ b/test/snapshot_test.dart
@@ -21,7 +21,7 @@
         ])
       ]);
 
-      await d.appDir({'foo': '1.2.3'}).create();
+      await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
       await pubGet(
           args: ['--precompile'],
@@ -59,7 +59,7 @@
         ])
         ..serve('bar', '1.2.3', deps: {'foo': '1.2.3'});
 
-      await d.appDir({'foo': '1.2.3'}).create();
+      await d.appDir(dependencies: {'foo': '1.2.3'}).create();
 
       await pubGet(
           args: ['--precompile'],
@@ -92,7 +92,7 @@
               'bin', [d.file('hello.dart', "void main() => print('hello!');")])
         ]);
 
-        await d.appDir({'foo': 'any'}).create();
+        await d.appDir(dependencies: {'foo': 'any'}).create();
 
         await pubGet(
             args: ['--precompile'], output: contains('Built foo:hello.'));
@@ -136,7 +136,7 @@
           d.dir('lib', [d.file('bar.dart', "final message = 'hello!';")])
         ]);
 
-        await d.appDir({'foo': 'any'}).create();
+        await d.appDir(dependencies: {'foo': 'any'}).create();
 
         await pubGet(
             args: ['--precompile'], output: contains('Built foo:hello.'));
@@ -170,7 +170,7 @@
               'bin', [d.file('hello.dart', "void main() => print('Hello!');")])
         ]).create();
 
-        await d.appDir({
+        await d.appDir(dependencies: {
           'foo': {'git': '../foo.git'}
         }).create();
 
@@ -205,7 +205,7 @@
               'bin', [d.file('hello.dart', "void main() => print('hello!');")])
         ]);
 
-        await d.appDir({'foo': '5.6.7'}).create();
+        await d.appDir(dependencies: {'foo': '5.6.7'}).create();
 
         await pubGet(args: ['--no-precompile']);
 
diff --git a/test/unknown_source_test.dart b/test/unknown_source_test.dart
index 37591d0..858e7c0 100644
--- a/test/unknown_source_test.dart
+++ b/test/unknown_source_test.dart
@@ -12,7 +12,7 @@
 void main() {
   forBothPubGetAndUpgrade((command) {
     test('fails gracefully on a dependency from an unknown source', () async {
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {'bad': 'foo'}
       }).create();
 
@@ -32,7 +32,7 @@
         })
       ]).create();
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {'path': '../foo'}
       }).create();
 
@@ -49,7 +49,7 @@
 
       // Depend on "foo" from a valid source.
       await d.dir(appPath, [
-        d.appPubspec({
+        d.appPubspec(dependencies: {
           'foo': {'path': '../foo'}
         })
       ]).create();
diff --git a/test/upgrade/dry_run_does_not_apply_changes_test.dart b/test/upgrade/dry_run_does_not_apply_changes_test.dart
index 4f514f9..ff3659c 100644
--- a/test/upgrade/dry_run_does_not_apply_changes_test.dart
+++ b/test/upgrade/dry_run_does_not_apply_changes_test.dart
@@ -16,7 +16,7 @@
       ..serve('foo', '2.0.0');
 
     // Create the first lockfile.
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
 
     await pubGet();
 
@@ -26,7 +26,7 @@
     ]).validate();
 
     // Change the pubspec.
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     // Also delete the ".dart_tool" directory.
     deleteEntry(path.join(d.sandbox, appPath, '.dart_tool'));
@@ -53,7 +53,7 @@
       ..serve('foo', '1.0.0')
       ..serve('foo', '2.0.0');
 
-    await d.appDir({'foo': '^1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '^1.0.0'}).create();
 
     await pubGet();
 
@@ -80,7 +80,7 @@
 
     await d.dir(appPath, [
       // The pubspec should not be modified.
-      d.appPubspec({'foo': '^1.0.0'}),
+      d.appPubspec(dependencies: {'foo': '^1.0.0'}),
       // The lockfile should not be modified.
       d.file('pubspec.lock', contains('1.0.0')),
       // The ".dart_tool" directory should not have been regenerated.
@@ -100,7 +100,7 @@
     );
 
     await d.dir(appPath, [
-      d.appPubspec({'foo': '^2.0.0'}),
+      d.appPubspec(dependencies: {'foo': '^2.0.0'}),
       d.file('pubspec.lock', contains('2.0.0')),
       d.dir('.dart_tool')
     ]).validate();
diff --git a/test/upgrade/git/do_not_upgrade_if_unneeded_test.dart b/test/upgrade/git/do_not_upgrade_if_unneeded_test.dart
index 5638fb9..93263f0 100644
--- a/test/upgrade/git/do_not_upgrade_if_unneeded_test.dart
+++ b/test/upgrade/git/do_not_upgrade_if_unneeded_test.dart
@@ -28,7 +28,7 @@
     await d.git('foo_dep.git',
         [d.libDir('foo_dep'), d.libPubspec('foo_dep', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/upgrade/git/upgrade_locked_test.dart b/test/upgrade/git/upgrade_locked_test.dart
index a8e744f..f93da2d 100644
--- a/test/upgrade/git/upgrade_locked_test.dart
+++ b/test/upgrade/git/upgrade_locked_test.dart
@@ -17,7 +17,7 @@
     await d.git(
         'bar.git', [d.libDir('bar'), d.libPubspec('bar', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'},
       'bar': {'git': '../bar.git'}
     }).create();
diff --git a/test/upgrade/git/upgrade_one_locked_test.dart b/test/upgrade/git/upgrade_one_locked_test.dart
index 5c41fa6..fd62cb7 100644
--- a/test/upgrade/git/upgrade_one_locked_test.dart
+++ b/test/upgrade/git/upgrade_one_locked_test.dart
@@ -17,7 +17,7 @@
     await d.git(
         'bar.git', [d.libDir('bar'), d.libPubspec('bar', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'},
       'bar': {'git': '../bar.git'}
     }).create();
diff --git a/test/upgrade/git/upgrade_to_incompatible_pubspec_test.dart b/test/upgrade/git/upgrade_to_incompatible_pubspec_test.dart
index e74a11e..3026281 100644
--- a/test/upgrade/git/upgrade_to_incompatible_pubspec_test.dart
+++ b/test/upgrade/git/upgrade_to_incompatible_pubspec_test.dart
@@ -15,7 +15,7 @@
     await d.git(
         'foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/upgrade/git/upgrade_to_nonexistent_pubspec_test.dart b/test/upgrade/git/upgrade_to_nonexistent_pubspec_test.dart
index ae865eb..8404d7d 100644
--- a/test/upgrade/git/upgrade_to_nonexistent_pubspec_test.dart
+++ b/test/upgrade/git/upgrade_to_nonexistent_pubspec_test.dart
@@ -15,7 +15,7 @@
         d.git('foo.git', [d.libDir('foo'), d.libPubspec('foo', '1.0.0')]);
     await repo.create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'git': '../foo.git'}
     }).create();
 
diff --git a/test/upgrade/hosted/unlock_if_necessary_test.dart b/test/upgrade/hosted/unlock_if_necessary_test.dart
index 2707100..37ed5ec 100644
--- a/test/upgrade/hosted/unlock_if_necessary_test.dart
+++ b/test/upgrade/hosted/unlock_if_necessary_test.dart
@@ -16,7 +16,7 @@
     server.serve('foo', '1.0.0', deps: {'foo_dep': 'any'});
     server.serve('foo_dep', '1.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubGet();
 
diff --git a/test/upgrade/hosted/unlock_single_package_test.dart b/test/upgrade/hosted/unlock_single_package_test.dart
index e443a6a..f95170f 100644
--- a/test/upgrade/hosted/unlock_single_package_test.dart
+++ b/test/upgrade/hosted/unlock_single_package_test.dart
@@ -14,7 +14,7 @@
     server.serve('foo', '1.0.0', deps: {'bar': '<2.0.0'});
     server.serve('bar', '1.0.0');
 
-    await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
 
     await pubGet();
 
diff --git a/test/upgrade/hosted/upgrade_removed_constraints_test.dart b/test/upgrade/hosted/upgrade_removed_constraints_test.dart
index cf72c07..c5fd70e 100644
--- a/test/upgrade/hosted/upgrade_removed_constraints_test.dart
+++ b/test/upgrade/hosted/upgrade_removed_constraints_test.dart
@@ -15,7 +15,7 @@
       ..serve('shared_dep', '1.0.0')
       ..serve('shared_dep', '2.0.0');
 
-    await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
 
     await pubUpgrade();
 
@@ -25,7 +25,7 @@
       d.packageConfigEntry(name: 'shared_dep', version: '1.0.0'),
     ]).validate();
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await pubUpgrade();
 
diff --git a/test/upgrade/hosted/warn_about_discontinued_test.dart b/test/upgrade/hosted/warn_about_discontinued_test.dart
index 33402d8..c3f01f1 100644
--- a/test/upgrade/hosted/warn_about_discontinued_test.dart
+++ b/test/upgrade/hosted/warn_about_discontinued_test.dart
@@ -12,7 +12,7 @@
     final server = await servePackages()
       ..serve('foo', '1.2.3', deps: {'transitive': 'any'})
       ..serve('transitive', '1.0.0');
-    await d.appDir({'foo': '1.2.3'}).create();
+    await d.appDir(dependencies: {'foo': '1.2.3'}).create();
     await pubGet();
 
     server
diff --git a/test/upgrade/report/describes_change_test.dart b/test/upgrade/report/describes_change_test.dart
index 2f92618..8ddc27f 100644
--- a/test/upgrade/report/describes_change_test.dart
+++ b/test/upgrade/report/describes_change_test.dart
@@ -17,7 +17,7 @@
     server.discontinue('foo');
 
     // Create the first lockfile.
-    await d.appDir({'foo': '2.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '2.0.0'}).create();
 
     await pubGet();
 
@@ -62,7 +62,7 @@
     ]).create();
 
     // Create the first lockfile.
-    await d.appDir({
+    await d.appDir(dependencies: {
       'unchanged': 'any',
       'contents_changed': '1.0.0',
       'version_upgraded': '1.0.0',
@@ -80,7 +80,7 @@
     );
 
     // Change the pubspec.
-    await d.appDir({
+    await d.appDir(dependencies: {
       'unchanged': 'any',
       'version_upgraded': 'any',
       'version_downgraded': '1.0.0',
diff --git a/test/upgrade/report/does_not_show_newer_versions_for_locked_packages_test.dart b/test/upgrade/report/does_not_show_newer_versions_for_locked_packages_test.dart
index ef987b9..1fb5964 100644
--- a/test/upgrade/report/does_not_show_newer_versions_for_locked_packages_test.dart
+++ b/test/upgrade/report/does_not_show_newer_versions_for_locked_packages_test.dart
@@ -20,12 +20,14 @@
       ..serve('upgraded', '3.0.0-dev');
 
     // Constraint everything to the first version.
-    await d.appDir({'not_upgraded': '1.0.0', 'upgraded': '1.0.0'}).create();
+    await d.appDir(
+        dependencies: {'not_upgraded': '1.0.0', 'upgraded': '1.0.0'}).create();
 
     await pubGet();
 
     // Loosen the constraints.
-    await d.appDir({'not_upgraded': 'any', 'upgraded': 'any'}).create();
+    await d.appDir(
+        dependencies: {'not_upgraded': 'any', 'upgraded': 'any'}).create();
 
     // Only upgrade "upgraded".
     await pubUpgrade(args: ['upgraded'], output: RegExp(r'''
diff --git a/test/upgrade/report/shows_newer_available_versions_test.dart b/test/upgrade/report/shows_newer_available_versions_test.dart
index 39d4e1a..b93a7b8 100644
--- a/test/upgrade/report/shows_newer_available_versions_test.dart
+++ b/test/upgrade/report/shows_newer_available_versions_test.dart
@@ -31,7 +31,7 @@
       ..serve('one_newer_stable', '1.0.1');
 
     // Constraint everything to the first version.
-    await d.appDir({
+    await d.appDir(dependencies: {
       'multiple_newer': '1.0.0',
       'multiple_newer_stable': '1.0.0',
       'multiple_newer_unstable': '1.0.0',
diff --git a/test/upgrade/report/shows_number_of_changed_dependencies_test.dart b/test/upgrade/report/shows_number_of_changed_dependencies_test.dart
index 91ba5aa..784fc83 100644
--- a/test/upgrade/report/shows_number_of_changed_dependencies_test.dart
+++ b/test/upgrade/report/shows_number_of_changed_dependencies_test.dart
@@ -16,13 +16,13 @@
       ..serve('b', '1.0.0')
       ..serve('c', '2.0.0');
 
-    await d.appDir({'a': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any'}).create();
 
     // One dependency changed.
     await pubUpgrade(output: RegExp(r'Changed 1 dependency!$'));
 
     // Remove one and add two.
-    await d.appDir({'b': 'any', 'c': 'any'}).create();
+    await d.appDir(dependencies: {'b': 'any', 'c': 'any'}).create();
 
     await pubUpgrade(output: RegExp(r'Changed 3 dependencies!$'));
 
diff --git a/test/upgrade/report/shows_pub_outdated_test.dart b/test/upgrade/report/shows_pub_outdated_test.dart
index 0fdb322..501f4f1 100644
--- a/test/upgrade/report/shows_pub_outdated_test.dart
+++ b/test/upgrade/report/shows_pub_outdated_test.dart
@@ -28,7 +28,7 @@
       ..serve('one_newer_stable', '1.0.1');
 
     // Constraint everything to the first version.
-    await d.appDir({
+    await d.appDir(dependencies: {
       'multiple_newer': '1.0.0',
       'multiple_newer_stable': '1.0.0',
       'multiple_newer_unstable': '1.0.0',
@@ -49,7 +49,7 @@
 Try `flutter pub outdated` for more information.$''', multiLine: true));
 
     // Upgrade `multiple_newer` to `1.0.1`.
-    await d.appDir({
+    await d.appDir(dependencies: {
       'multiple_newer': '1.0.1',
       'multiple_newer_stable': '1.0.0',
       'multiple_newer_unstable': '1.0.0',
@@ -64,7 +64,7 @@
 Try `dart pub outdated` for more information.$''', multiLine: true));
 
     // Upgrade `multiple_newer` to `1.0.2-unstable.1`.
-    await d.appDir({
+    await d.appDir(dependencies: {
       'multiple_newer': '1.0.2-unstable.1',
       'multiple_newer_stable': '1.0.0',
       'multiple_newer_unstable': '1.0.0',
@@ -79,7 +79,7 @@
 Try `dart pub outdated` for more information.$''', multiLine: true));
 
     // Upgrade all except `one_newer_stable`.
-    await d.appDir({
+    await d.appDir(dependencies: {
       'multiple_newer': '1.0.2-unstable.2',
       'multiple_newer_stable': '1.0.2',
       'multiple_newer_unstable': '1.0.1-unstable.2',
diff --git a/test/upgrade/upgrade_major_versions_test.dart b/test/upgrade/upgrade_major_versions_test.dart
index c5f0994..4bdff58 100644
--- a/test/upgrade/upgrade_major_versions_test.dart
+++ b/test/upgrade/upgrade_major_versions_test.dart
@@ -18,7 +18,7 @@
         ..serve('baz', '1.0.0')
         ..serve('baz', '1.0.1');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': '^1.0.0',
         'bar': '^0.1.0',
         'baz': '^1.0.0',
@@ -36,7 +36,7 @@
         ]),
       );
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': '^2.0.0',
         'bar': '^0.2.0',
         'baz': '^1.0.0',
@@ -104,7 +104,7 @@
         ..serve('foo', '2.0.0')
         ..serve('bar', '0.1.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': '^1.0.0',
         'bar': '^0.1.0',
       }).create();
@@ -122,7 +122,7 @@
         ]),
       );
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': '^2.0.0', // bumped
         'bar': '^0.1.0',
       }).validate();
@@ -139,7 +139,7 @@
         ..serve('foo', '2.0.0')
         ..serve('foo', '3.0.0');
 
-      await d.appDir({'foo': '^1.0.0'}).create();
+      await d.appDir(dependencies: {'foo': '^1.0.0'}).create();
 
       await pubGet();
 
@@ -235,7 +235,7 @@
         ..serve('bar', '3.0.0')
         ..serve('bar', '4.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': '^1.0.0',
         'bar': '^2.0.0',
       }).create();
@@ -251,7 +251,7 @@
         ]),
       );
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': '^1.0.0',
         'bar': '^4.0.0',
       }).validate();
diff --git a/test/version_solver_test.dart b/test/version_solver_test.dart
index fbe687a..97a2736 100644
--- a/test/version_solver_test.dart
+++ b/test/version_solver_test.dart
@@ -48,7 +48,7 @@
       ..serve('ba', '1.0.0')
       ..serve('bb', '1.0.0');
 
-    await d.appDir({'a': '1.0.0', 'b': '1.0.0'}).create();
+    await d.appDir(dependencies: {'a': '1.0.0', 'b': '1.0.0'}).create();
     await expectResolves(result: {
       'a': '1.0.0',
       'aa': '1.0.0',
@@ -69,7 +69,7 @@
       ..serve('shared', '4.0.0')
       ..serve('shared', '5.0.0');
 
-    await d.appDir({'a': '1.0.0', 'b': '1.0.0'}).create();
+    await d.appDir(dependencies: {'a': '1.0.0', 'b': '1.0.0'}).create();
     await expectResolves(
         result: {'a': '1.0.0', 'b': '1.0.0', 'shared': '3.6.9'});
   });
@@ -87,7 +87,7 @@
       ..serve('whoop', '1.0.0')
       ..serve('zoop', '1.0.0');
 
-    await d.appDir({'foo': '<=1.0.2', 'bar': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '<=1.0.2', 'bar': '1.0.0'}).create();
     await expectResolves(
         result: {'foo': '1.0.1', 'bar': '1.0.0', 'bang': '1.0.0'});
   });
@@ -97,7 +97,7 @@
       ..serve('foo', '1.0.0', deps: {'bar': '1.0.0'})
       ..serve('bar', '1.0.0', deps: {'foo': '1.0.0'});
 
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await expectResolves(result: {'foo': '1.0.0', 'bar': '1.0.0'});
   });
 
@@ -109,7 +109,7 @@
       ..serve('bar', '2.0.0', deps: {'baz': '1.0.0'})
       ..serve('baz', '1.0.0', deps: {'foo': '2.0.0'});
 
-    await d.appDir({'foo': '1.0.0', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0', 'bar': 'any'}).create();
     await expectResolves(result: {'foo': '1.0.0', 'bar': '1.0.0'}, tries: 2);
   });
 }
@@ -124,10 +124,10 @@
       ..serve('bar', '1.0.1')
       ..serve('bar', '1.0.2');
 
-    await d.appDir({'foo': '1.0.1'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.1'}).create();
     await expectResolves(result: {'foo': '1.0.1', 'bar': '1.0.1'});
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(result: {'foo': '1.0.1', 'bar': '1.0.1'});
   });
 
@@ -140,10 +140,10 @@
       ..serve('bar', '1.0.1')
       ..serve('bar', '1.0.2');
 
-    await d.appDir({'foo': '1.0.1'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.1'}).create();
     await expectResolves(result: {'foo': '1.0.1', 'bar': '1.0.1'});
 
-    await d.appDir({'foo': '>1.0.1'}).create();
+    await d.appDir(dependencies: {'foo': '>1.0.1'}).create();
     await expectResolves(result: {'foo': '1.0.2', 'bar': '1.0.2'});
   });
 
@@ -157,10 +157,10 @@
       ..serve('bar', '1.0.2')
       ..serve('baz', '1.0.0');
 
-    await d.appDir({'baz': '1.0.0'}).create();
+    await d.appDir(dependencies: {'baz': '1.0.0'}).create();
     await expectResolves(result: {'baz': '1.0.0'});
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(result: {'foo': '1.0.2', 'bar': '1.0.2'});
   });
 
@@ -178,7 +178,7 @@
       ..serve('qux', '2.0.0')
       ..serve('newdep', '2.0.0', deps: {'baz': '>=1.5.0'});
 
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await expectResolves(result: {
       'foo': '1.0.0',
       'bar': '1.0.0',
@@ -186,7 +186,7 @@
       'qux': '1.0.0'
     });
 
-    await d.appDir({'foo': 'any', 'newdep': '2.0.0'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'newdep': '2.0.0'}).create();
     await expectResolves(result: {
       'foo': '2.0.0',
       'bar': '2.0.0',
@@ -205,10 +205,10 @@
       ..serve('bar', '1.0.0')
       ..serve('bar', '2.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(result: {'foo': '1.0.0', 'bar': '2.0.0'});
 
-    await d.appDir({'foo': 'any', 'bar': '<2.0.0'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': '<2.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       Because myapp depends on foo any which depends on bar >=2.0.0,
         bar >=2.0.0 is required.
@@ -222,7 +222,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0', deps: {'myapp': 'any'});
 
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await expectResolves(result: {'foo': '1.0.0'});
   });
 
@@ -233,7 +233,7 @@
         'myapp': {'git': 'http://nowhere.com/'}
       });
 
-    await d.appDir({'foo': '1.0.0', 'bar': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0', 'bar': '1.0.0'}).create();
     await expectResolves(result: {'foo': '1.0.0', 'bar': '1.0.0'});
   });
 
@@ -241,7 +241,7 @@
     final server = await servePackages();
     server.serve('foo', '1.0.0', deps: {'myapp': '>0.0.0'});
 
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       Because myapp depends on foo 1.0.0 which depends on myapp >0.0.0,
         myapp >0.0.0 is required.
@@ -287,7 +287,7 @@
       'dev_dependencies': {'bar': '1.0.0'}
     });
 
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await expectResolves(result: {'foo': '1.0.0'});
   });
 
@@ -415,7 +415,7 @@
       ..serve('foo', '2.0.0')
       ..serve('foo', '2.1.3');
 
-    await d.appDir({'foo': '>=1.0.0 <2.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '>=1.0.0 <2.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace("""
       Because myapp depends on foo ^1.0.0 which doesn't match any versions,
         version solving failed.
@@ -429,7 +429,7 @@
       ..serve('shared', '2.5.0')
       ..serve('shared', '3.5.0');
 
-    await d.appDir({'foo': '1.0.0', 'bar': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0', 'bar': '1.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       Because every version of foo depends on shared ^2.0.0 and no versions of
         shared match ^2.9.0, every version of foo requires
@@ -448,7 +448,7 @@
       ..serve('shared', '2.0.0')
       ..serve('shared', '4.0.0');
 
-    await d.appDir({'foo': '1.0.0', 'bar': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0', 'bar': '1.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       Because every version of bar depends on shared >3.0.0 and every version
         of foo depends on shared <=2.0.0, bar is incompatible with foo.
@@ -471,7 +471,7 @@
       })
       ..serve('shared', '1.0.0');
 
-    await d.appDir({'foo': '1.0.0', 'bar': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0', 'bar': '1.0.0'}).create();
 
     await expectResolves(
         error: allOf([
@@ -495,7 +495,7 @@
       })
       ..serve('shared', '1.0.0');
 
-    await d.appDir({'foo': '1.0.0', 'bar': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0', 'bar': '1.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       Because every version of bar depends on shared from path and every
         version of foo depends on shared from hosted, bar is incompatible with
@@ -512,7 +512,7 @@
       ..serve('b', '1.0.0', deps: {'a': '2.0.0'})
       ..serve('b', '2.0.0', deps: {'a': '1.0.0'});
 
-    await d.appDir({'a': 'any', 'b': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'b': 'any'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       Because b <2.0.0 depends on a 2.0.0 which depends on b 2.0.0, b <2.0.0 is
         forbidden.
@@ -529,7 +529,7 @@
       ..serve('a', '1.0.0')
       ..serve('b', '1.0.0');
 
-    await d.appDir({'a': 'any', 'b': '>1.0.0'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'b': '>1.0.0'}).create();
     await expectResolves(error: equalsIgnoringWhitespace("""
       Because myapp depends on b >1.0.0 which doesn't match any versions,
         version solving failed.
@@ -551,7 +551,8 @@
       ..serve('di', '0.0.37', deps: {'analyzer': '>=0.13.0 <0.14.0'})
       ..serve('di', '0.0.36', deps: {'analyzer': '>=0.13.0 <0.14.0'});
 
-    await d.appDir({'angular': 'any', 'collection': 'any'}).create();
+    await d
+        .appDir(dependencies: {'angular': 'any', 'collection': 'any'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       Because every version of angular depends on di ^0.0.32 which depends on
         analyzer ^0.13.0, every version of angular requires analyzer ^0.13.0.
@@ -563,7 +564,7 @@
 
 void badSource() {
   test('fail if the root package has a bad source in dep', () async {
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {'bad': 'any'}
     }).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
@@ -600,7 +601,7 @@
         'bang': {'bad': 'any'}
       });
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       Because foo <1.0.1 depends on bar from unknown source "bad", foo <1.0.1 is
         forbidden.
@@ -624,7 +625,7 @@
       })
       ..serve('bar', '1.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(result: {'foo': '1.0.0', 'bar': '1.0.0'}, tries: 2);
   });
 
@@ -636,7 +637,7 @@
       ..serve('baz', '1.0.0');
     await d.dir('baz', [d.libPubspec('baz', '1.0.0')]).create();
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': 'any',
       'baz': {'path': '../baz'}
     }).create();
@@ -656,7 +657,7 @@
       ..serve('a', '2.0.0', deps: {'b': '1.0.0'})
       ..serve('b', '1.0.0', deps: {'a': '1.0.0'});
 
-    await d.appDir({'a': '>=1.0.0'}).create();
+    await d.appDir(dependencies: {'a': '>=1.0.0'}).create();
     await expectResolves(result: {'a': '1.0.0'}, tries: 2);
   });
 
@@ -670,7 +671,7 @@
       ..serve('c', '2.0.0')
       ..serve('c', '1.0.0');
 
-    await d.appDir({'a': 'any', 'b': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'b': 'any'}).create();
     await expectResolves(result: {'a': '1.0.0', 'b': '2.0.0', 'c': '3.0.0'});
   });
 
@@ -689,7 +690,7 @@
       ..serve('y', '1.0.0')
       ..serve('y', '2.0.0');
 
-    await d.appDir({'c': 'any', 'y': '^2.0.0'}).create();
+    await d.appDir(dependencies: {'c': 'any', 'y': '^2.0.0'}).create();
     await expectResolves(result: {'c': '1.0.0', 'y': '2.0.0'}, tries: 2);
   });
 
@@ -706,7 +707,7 @@
       ..serve('y', '1.0.0')
       ..serve('y', '2.0.0');
 
-    await d.appDir({'foo': '^1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '^1.0.0'}).create();
     await expectResolves(
         // We avoid equalsIgnoringWhitespace() here because we want to test the
         // formatting of the line number.
@@ -737,7 +738,7 @@
       ..serve('c', '1.0.0')
       ..serve('c', '2.0.0');
 
-    await d.appDir({'a': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any'}).create();
     await expectResolves(result: {'a': '2.0.0', 'b': '1.0.0', 'c': '2.0.0'});
   });
 
@@ -753,7 +754,7 @@
       ..serve('bar', '3.0.0', deps: {'baz': '3.0.0'})
       ..serve('baz', '1.0.0');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(
         result: {'foo': '1.0.0', 'bar': '1.0.0', 'baz': '1.0.0'}, tries: 3);
   });
@@ -771,7 +772,7 @@
       ..serve('b', '3.0.0')
       ..serve('c', '1.0.0');
 
-    await d.appDir({'a': 'any', 'b': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'b': 'any'}).create();
     await expectResolves(
         result: {'a': '1.0.0', 'b': '3.0.0', 'c': '1.0.0'}, tries: 2);
   });
@@ -805,7 +806,7 @@
       ..serve('c', '4.0.0')
       ..serve('c', '5.0.0');
 
-    await d.appDir({'a': 'any', 'b': 'any', 'c': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'b': 'any', 'c': 'any'}).create();
     await expectResolves(result: {'a': '1.0.0', 'b': '1.0.0', 'c': '5.0.0'});
   });
 
@@ -828,7 +829,7 @@
       ..serve('c', '4.0.0')
       ..serve('c', '5.0.0');
 
-    await d.appDir({'a': 'any', 'b': 'any', 'c': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'b': 'any', 'c': 'any'}).create();
     await expectResolves(result: {'a': '1.0.0', 'b': '1.0.0', 'c': '5.0.0'});
   });
 
@@ -848,7 +849,7 @@
       ..serve('c', '4.0.0')
       ..serve('c', '5.0.0');
 
-    await d.appDir({'a': 'any', 'b': 'any', 'c': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'b': 'any', 'c': 'any'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       Because every version of b depends on a from path and myapp depends on
         a from hosted, b is forbidden.
@@ -873,7 +874,7 @@
       ..serve('c', '4.0.0')
       ..serve('c', '5.0.0');
 
-    await d.appDir({'a': 'any', 'b': 'any', 'c': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'b': 'any', 'c': 'any'}).create();
     await expectResolves(
         error: allOf([
       contains('Because every version of b depends on a from hosted on '
@@ -903,7 +904,7 @@
       ..serve('c', '1.0.0')
       ..serve('c', '2.0.0');
 
-    await d.appDir({'a': 'any', 'b': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'b': 'any'}).create();
     await expectResolves(result: {'a': '4.0.0', 'b': '4.0.0', 'c': '2.0.0'});
   });
 
@@ -922,7 +923,7 @@
       }
     }
 
-    await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
     await expectResolves(
         result: {'foo': '0.9.0', 'bar': '9.0.0', 'baz': '0.0.0'}, tries: 10);
   });
@@ -944,7 +945,7 @@
       ..serve('foo', '2.0.3')
       ..serve('foo', '2.0.4');
 
-    await d.appDir({'a': 'any', 'foo': '>2.0.0'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'foo': '>2.0.0'}).create();
     await expectResolves(result: {'a': '1.0.0', 'foo': '2.0.4'});
   });
 
@@ -961,7 +962,7 @@
       ..serve('d', '2.0.0', deps: {'myapp': 'any'})
       ..serve('d', '1.0.0', deps: {'myapp': '<1.0.0'});
 
-    await d.appDir({'a': 'any', 'c': 'any', 'd': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any', 'c': 'any', 'd': 'any'}).create();
     await expectResolves(
         result: {'a': '1.0.0', 'b': '1.0.0', 'c': '1.0.0', 'd': '2.0.0'});
   });
@@ -983,28 +984,28 @@
     await d.dir(appPath, [
       d.pubspec({
         'name': 'myapp',
-        'environment': {'sdk': '0.0.0'}
+        'environment': {'sdk': '2.12.0'}
       })
     ]).create();
 
     await expectResolves(error: equalsIgnoringWhitespace('''
       The current Dart SDK version is 3.1.2+3.
 
-      Because myapp requires SDK version 0.0.0, version solving failed.
+      Because myapp requires SDK version 2.12.0, version solving failed.
     '''));
   });
 
   test('dependency does not match SDK', () async {
     final server = await servePackages();
     server.serve('foo', '1.0.0', pubspec: {
-      'environment': {'sdk': '0.0.0'}
+      'environment': {'sdk': '2.12.0'}
     });
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       The current Dart SDK version is 3.1.2+3.
 
-      Because myapp depends on foo any which requires SDK version 0.0.0, version
+      Because myapp depends on foo any which requires SDK version 2.12.0, version
         solving failed.
     '''));
   });
@@ -1013,15 +1014,15 @@
     await servePackages()
       ..serve('foo', '1.0.0', deps: {'bar': 'any'})
       ..serve('bar', '1.0.0', pubspec: {
-        'environment': {'sdk': '0.0.0'}
+        'environment': {'sdk': '2.12.0'}
       });
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(error: equalsIgnoringWhitespace('''
       The current Dart SDK version is 3.1.2+3.
 
       Because every version of foo depends on bar any which requires SDK version
-        0.0.0, foo is forbidden.
+        2.12.0, foo is forbidden.
       So, because myapp depends on foo any, version solving failed.
     '''));
   });
@@ -1041,7 +1042,7 @@
         'environment': {'sdk': '0.0.0'}
       });
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(result: {'foo': '2.0.0'});
   });
 
@@ -1061,7 +1062,7 @@
         'environment': {'sdk': '0.0.0'}
       });
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(result: {'foo': '1.0.0', 'bar': '2.0.0'});
   });
 
@@ -1086,7 +1087,7 @@
         'environment': {'sdk': '0.0.0'}
       });
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
     await expectResolves(result: {'foo': '2.0.0', 'bar': '2.0.0'}, tries: 2);
   });
 }
@@ -1114,7 +1115,7 @@
         'environment': {'flutter': 'any', 'sdk': defaultSdkConstraint}
       });
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
       await expectResolves(error: equalsIgnoringWhitespace('''
         Because myapp depends on foo any which requires the Flutter SDK, version
           solving failed.
@@ -1131,7 +1132,7 @@
           'environment': {'flutter': '0.0.0'}
         });
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
       await expectResolves(result: {'foo': '2.0.0'});
     });
 
@@ -1267,7 +1268,7 @@
           'environment': {'flutter': '^2.0.0', 'sdk': defaultSdkConstraint}
         });
 
-      await d.appDir({'foo': 'any'}).create();
+      await d.appDir(dependencies: {'foo': 'any'}).create();
       await expectResolves(
           environment: {'FLUTTER_ROOT': p.join(d.sandbox, 'flutter')},
           result: {'foo': '2.0.0'});
@@ -1283,7 +1284,7 @@
       ..serve('a', '2.0.0-dev')
       ..serve('a', '3.0.0-dev');
 
-    await d.appDir({'a': 'any'}).create();
+    await d.appDir(dependencies: {'a': 'any'}).create();
     await expectResolves(result: {'a': '1.0.0'});
   });
 
@@ -1294,7 +1295,7 @@
       ..serve('a', '1.9.0-dev')
       ..serve('a', '3.0.0');
 
-    await d.appDir({'a': '<2.0.0'}).create();
+    await d.appDir(dependencies: {'a': '<2.0.0'}).create();
     await expectResolves(result: {'a': '1.9.0-dev'});
   });
 
@@ -1305,7 +1306,7 @@
       ..serve('a', '2.0.0-dev')
       ..serve('a', '2.0.0');
 
-    await d.appDir({'a': '<2.0.0'}).create();
+    await d.appDir(dependencies: {'a': '<2.0.0'}).create();
     await expectResolves(result: {'a': '1.1.0'});
   });
 
@@ -1317,7 +1318,7 @@
       ..serve('a', '2.0.0-dev')
       ..serve('a', '2.0.0');
 
-    await d.appDir({'a': '<=2.0.0-dev'}).create();
+    await d.appDir(dependencies: {'a': '<=2.0.0-dev'}).create();
     await expectResolves(result: {'a': '1.1.0'});
   });
 
@@ -1326,7 +1327,7 @@
       ..serve('a', '1.0.0')
       ..serve('a', '1.1.0-dev');
 
-    await d.appDir({'a': '^1.1.0-dev'}).create();
+    await d.appDir(dependencies: {'a': '^1.1.0-dev'}).create();
     await expectResolves(result: {'a': '1.1.0-dev'});
   });
 
@@ -1336,7 +1337,7 @@
       ..serve('a', '1.1.0-dev')
       ..serve('a', '1.1.0');
 
-    await d.appDir({'a': '^1.1.0-dev'}).create();
+    await d.appDir(dependencies: {'a': '^1.1.0-dev'}).create();
     await expectResolves(result: {'a': '1.1.0'});
   });
 
@@ -1349,7 +1350,7 @@
       ..serve('b', '1.0.0')
       ..serve('b', '1.1.0-dev');
 
-    await d.appDir({'a': '^1.0.0'}).create();
+    await d.appDir(dependencies: {'a': '^1.0.0'}).create();
     await expectResolves(result: {
       'a': '1.1.0',
       'b': '1.1.0-dev',
@@ -1363,7 +1364,7 @@
       ..serve('b', '1.0.0')
       ..serve('b', '1.1.0-dev');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'a': '^1.0.0',
       'b': '^1.0.0', // Direct dependency prevents us from using a pre-release.
     }).create();
@@ -1383,7 +1384,7 @@
       ..serve('b', '1.1.0-dev')
       ..serve('c', '1.0.0', deps: {'b': '^1.0.0'});
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'a': '^1.0.0',
       'c': '^1.0.0', // This doesn't not prevent using a pre-release.
     }).create();
@@ -1405,7 +1406,7 @@
       ..serve('c', '2.0.1', deps: {});
 
     await d.appDir(
-      {
+      dependencies: {
         'a': '0.12.0',
         'b': 'any',
       },
@@ -1424,7 +1425,7 @@
       ..serve('b', '1.1.0-alpha')
       ..serve('a', '1.0.0', deps: {'b': '^1.1.0-alpha'});
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'a': '^1.0.0',
     }).create();
     await expectResolves(tries: 2);
@@ -1511,7 +1512,7 @@
       ..serve('bar', '1.0.1')
       ..serve('bar', '1.0.2');
 
-    await d.appDir({'foo': '1.0.1'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.1'}).create();
     await expectResolves(result: {'foo': '1.0.1', 'bar': '1.0.1'});
 
     await d.dir(appPath, [
@@ -1533,7 +1534,7 @@
       ..serve('bar', '1.0.1')
       ..serve('bar', '1.0.2');
 
-    await d.appDir({'foo': '1.0.1'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.1'}).create();
     await expectResolves(result: {'foo': '1.0.1', 'bar': '1.0.1'});
 
     await d.dir(appPath, [
@@ -1619,7 +1620,7 @@
       ..serve('bar', '1.2.3')
       ..serve('bar', '0.0.1');
 
-    await d.appDir({'foo': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any'}).create();
 
     await expectResolves(result: {'foo': '1.2.3', 'bar': '1.2.3'});
 
@@ -1681,10 +1682,10 @@
       ..serve('foo', '2.0.0')
       ..serve('foo', '2.1.0');
 
-    await d.appDir({'foo': '2.1.0'}).create();
+    await d.appDir(dependencies: {'foo': '2.1.0'}).create();
     await expectResolves(result: {'foo': '2.1.0'});
 
-    await d.appDir({'foo': '>=2.0.0 <3.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '>=2.0.0 <3.0.0'}).create();
     await expectResolves(result: {'foo': '2.0.0'}, downgrade: true);
   });
 
@@ -1697,7 +1698,7 @@
       ..serve('a', '2.0.0-dev.2')
       ..serve('a', '2.0.0-dev.3');
 
-    await d.appDir({'a': '>=2.0.0-dev.1 <3.0.0'}).create();
+    await d.appDir(dependencies: {'a': '>=2.0.0-dev.1 <3.0.0'}).create();
     await expectResolves(result: {'a': '2.0.0-dev.1'}, downgrade: true);
   });
 }
@@ -1715,7 +1716,7 @@
       })
       ..serve('bar', '1.0.0');
 
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await expectResolves(result: {'foo': '1.0.0'});
   });
 
@@ -1731,7 +1732,7 @@
       })
       ..serve('bar', '1.0.0');
 
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await expectResolves(result: {'foo': '1.0.0', 'bar': '1.0.0'});
   });
 
@@ -1746,7 +1747,7 @@
       })
       ..serve('bar', '1.0.0');
 
-    await d.appDir({'foo': '1.0.0'}).create();
+    await d.appDir(dependencies: {'foo': '1.0.0'}).create();
     await expectResolves(result: {'foo': '1.0.0', 'bar': '1.0.0'});
   });
 
@@ -1762,7 +1763,7 @@
       })
       ..serve('bar', '1.0.0');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '1.0.0',
         'features': {'stuff': true}
@@ -1782,7 +1783,7 @@
       })
       ..serve('bar', '1.0.0');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '1.0.0',
         'features': {'stuff': false}
@@ -1808,7 +1809,7 @@
         }
       });
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '1.0.0',
         'features': {'stuff': false}
@@ -1835,7 +1836,7 @@
         }
       });
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '1.0.0',
         'features': {'stuff': false}
@@ -1859,7 +1860,7 @@
       ..serve('foo', '1.1.0')
       ..serve('bar', '1.0.0');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '1.0.0',
         'features': {'stuff': true}
@@ -1889,7 +1890,7 @@
       ..serve('bar', '1.0.0')
       ..serve('bar', '2.0.0');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '^1.0.0',
         'features': {'stuff': true}
@@ -1934,7 +1935,7 @@
       ..serve('baz', '1.0.0')
       ..serve('baz', '2.0.0');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '^1.0.0',
         'features': {'stuff': true}
@@ -1969,7 +1970,7 @@
       ..serve('baz', '1.0.0')
       ..serve('baz', '2.0.0');
 
-    await d.appDir({
+    await d.appDir(dependencies: {
       'foo': {
         'version': '^1.0.0',
         'features': {'stuff': true}
@@ -2136,7 +2137,7 @@
         })
         ..serve('bar', '1.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'version': '1.0.0',
           'features': {'stuff': 'if available'}
@@ -2149,7 +2150,7 @@
       final server = await servePackages();
       server.serve('foo', '1.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'version': '1.0.0',
           'features': {'stuff': 'if available'}
@@ -2372,12 +2373,12 @@
         })
         ..serve('baz', '1.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {'version': '1.0.0'}
       }).create();
       await expectResolves(result: {'foo': '1.0.0', 'bar': '1.0.0'});
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'version': '1.0.0',
           'features': {'stuff': true}
@@ -2417,7 +2418,7 @@
         })
         ..serve('baz', '1.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'version': '1.0.0',
           'features': {'stuff': true}
@@ -2450,7 +2451,7 @@
         ..serve('bar', '1.0.0')
         ..serve('baz', '1.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'version': '1.0.0',
           'features': {'main': true}
@@ -2480,7 +2481,7 @@
         ..serve('bar', '1.0.0')
         ..serve('baz', '1.0.0');
 
-      await d.appDir({'foo': '1.0.0'}).create();
+      await d.appDir(dependencies: {'foo': '1.0.0'}).create();
       await expectResolves(
           result: {'foo': '1.0.0', 'bar': '1.0.0', 'baz': '1.0.0'});
     });
@@ -2500,7 +2501,7 @@
         })
         ..serve('bar', '1.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'version': '1.0.0',
           'features': {'main': false}
@@ -2525,7 +2526,7 @@
         })
         ..serve('bar', '1.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'version': '1.0.0',
           'features': {'main': true, 'required': false}
@@ -2553,7 +2554,7 @@
         })
         ..serve('bar', '1.0.0');
 
-      await d.appDir({
+      await d.appDir(dependencies: {
         'foo': {
           'version': '1.0.0',
           'features': {'main': true}
@@ -2637,7 +2638,7 @@
       ..serve('integration_test', '1.0.2+2',
           deps: {'vm_service': '>= 4.2.0 <7.0.0'})
       ..serve('vm_service', '7.3.0');
-    await d.appDir({'integration_test': '^1.0.2'}).create();
+    await d.appDir(dependencies: {'integration_test': '^1.0.2'}).create();
     await expectResolves(
       error: contains(
         'Because no versions of integration_test match >=1.0.2 <1.0.2+2',
@@ -2660,7 +2661,7 @@
       ..serve('bar', '1.0.0', deps: {
         'baz': {'sdk': 'flutter'}
       });
-    await d.appDir({'foo': 'any', 'bar': 'any'}).create();
+    await d.appDir(dependencies: {'foo': 'any', 'bar': 'any'}).create();
     await expectResolves(
       environment: {'FLUTTER_ROOT': p.join(d.sandbox, 'flutter')},
     );