You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5a6cfa7
Browse filesBrowse the repository at this point in the historyBrowse files
[tool] Migrate ScreenshotCommand to modular dependency injection (#190767)
## Summary
Part 9 of the modular dependency injection migration.
* Migrates `ScreenshotCommand` to constructor dependency injection with
required non-nullable `ToolContext`:
```dart
ScreenshotCommand({
required super.toolContext,
VMServiceConnector? vmServiceConnector,
})
```
* Eliminates ambient `globals.dart` usage and `fs` constructor fallback
parameter in `screenshot.dart`, resolving `fs`, `fileSystemUtils`, and
`logger` directly from `toolContext`.
* Conditionalizes `refreshWirelessDevices` on `argResults == null ||
stringArg(_kType) == _kDeviceType` to preserve hermetic execution for
Skia VM service screenshot mode under `testWithoutContext`.
* Wires `toolContext: toolDependencies.toolContext` in
`executable.dart`.
* Migrates unit tests in
`packages/flutter_tools/test/commands.shard/hermetic/screenshot_command_test.dart`
to hermetic `testWithoutContext`.
Part of #188471
0 commit comments