diff --git a/packages/flutter_tools/lib/src/flutter_cache.dart b/packages/flutter_tools/lib/src/flutter_cache.dart index 4874af196d45..f4ce3cd8c389 100644 --- a/packages/flutter_tools/lib/src/flutter_cache.dart +++ b/packages/flutter_tools/lib/src/flutter_cache.dart @@ -98,7 +98,7 @@ class PubDependencies extends ArtifactSet { return false; } for (final Package package in packageConfig.packages) { - if (!fileSystem.directory(package.packageUriRoot).existsSync()) { + if (!fileSystem.directory(package.root).childFile('pubspec.yaml').existsSync()) { return false; } } diff --git a/packages/flutter_tools/test/general.shard/cache_test.dart b/packages/flutter_tools/test/general.shard/cache_test.dart index 8edda353c712..18684fb90d11 100644 --- a/packages/flutter_tools/test/general.shard/cache_test.dart +++ b/packages/flutter_tools/test/general.shard/cache_test.dart @@ -936,7 +936,7 @@ void main() { expect(await pubDependencies.isUpToDate(fileSystem), false); // dependencies are missing. - fileSystem.file('.pub-cache/hosted/pub.dartlang.org/example-7.0.0/lib/foo.dart') + fileSystem.file('.pub-cache/hosted/pub.dartlang.org/example-7.0.0/pubspec.yaml') .createSync(recursive: true); expect(await pubDependencies.isUpToDate(fileSystem), true);