diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart index 7f3e6abaee..7b70f107a6 100644 --- a/packages/flutter_tools/lib/src/artifacts.dart +++ b/packages/flutter_tools/lib/src/artifacts.dart @@ -1028,7 +1028,12 @@ class CachedLocalEngineArtifacts implements Artifacts { case Artifact.flutterToolsFileGenerators: return _getFileGeneratorsPath(); case Artifact.flutterPreviewDevice: - throw UnimplementedError('The preview device is not supported with local engine builds'); + return _backupCache.getArtifactPath( + artifact, + platform: platform, + mode: mode, + environmentType: environmentType, + ); } } diff --git a/packages/flutter_tools/test/general.shard/artifacts_test.dart b/packages/flutter_tools/test/general.shard/artifacts_test.dart index dc39ffe002..bb0915c25d 100644 --- a/packages/flutter_tools/test/general.shard/artifacts_test.dart +++ b/packages/flutter_tools/test/general.shard/artifacts_test.dart @@ -329,6 +329,14 @@ void main() { 'snapshots', 'frontend_server_aot.dart.snapshot') ); + expect( + artifacts.getArtifactPath( + Artifact.flutterPreviewDevice, + platform: TargetPlatform.windows_x64, + ), + fileSystem.path.join('root', 'bin', 'cache', 'artifacts', + 'flutter_preview', 'flutter_preview.exe'), + ); fileSystem.file(fileSystem.path.join('/out', 'host_debug_unopt', 'impellerc')) .createSync(recursive: true);