Skip to content

Commit 8969288

Browse files
[flutter_tools] Fix local engine preview device (flutter#138046)
Fixes flutter#137982
1 parent e724689 commit 8969288

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

packages/flutter_tools/lib/src/artifacts.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,12 @@ class CachedLocalEngineArtifacts implements Artifacts {
10281028
case Artifact.flutterToolsFileGenerators:
10291029
return _getFileGeneratorsPath();
10301030
case Artifact.flutterPreviewDevice:
1031-
throw UnimplementedError('The preview device is not supported with local engine builds');
1031+
return _backupCache.getArtifactPath(
1032+
artifact,
1033+
platform: platform,
1034+
mode: mode,
1035+
environmentType: environmentType,
1036+
);
10321037
}
10331038
}
10341039

packages/flutter_tools/test/general.shard/artifacts_test.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,14 @@ void main() {
329329
'snapshots', 'frontend_server_aot.dart.snapshot')
330330
);
331331

332+
expect(
333+
artifacts.getArtifactPath(
334+
Artifact.flutterPreviewDevice,
335+
platform: TargetPlatform.windows_x64,
336+
),
337+
fileSystem.path.join('root', 'bin', 'cache', 'artifacts',
338+
'flutter_preview', 'flutter_preview.exe'),
339+
);
332340

333341
fileSystem.file(fileSystem.path.join('/out', 'host_debug_unopt', 'impellerc'))
334342
.createSync(recursive: true);

0 commit comments

Comments
 (0)