testGoldensOnWindows function
- @isTest
- String description,
- WidgetTesterCallback test, {
- bool skip = false,
- Size? windowSize,
A golden test that configures itself as a Windows platform before executing the
given test, and nullifies the Windows configuration when the test is done.
Implementation
@isTest
void testGoldensOnWindows(
String description,
WidgetTesterCallback test, {
bool skip = false,
Size? windowSize,
}) {
testGoldens(description, (tester) async {
debugDefaultTargetPlatformOverride = TargetPlatform.windows;
// Adjust the size of the golden window/image as desired.
tester.viewSize = windowSize;
try {
await test(tester);
} finally {
debugDefaultTargetPlatformOverride = null;
}
}, skip: skip);
}