runWithDeviceOverrides method
Configure the Test device for the duration of the supplied operation and revert
device
the desired configuration to apply
body
the closure you wish to be executed with the device configuration applied
Implementation
Future<void> runWithDeviceOverrides(
Device device, {
required Future<void> Function() body,
}) async {
await applyDeviceOverrides(device);
try {
await body();
} finally {
await resetDeviceOverrides();
}
}