emulateMediaFeatures method
Given an array of media feature objects, emulates CSS media features on the page.
Implementation
Future<void> emulateMediaFeatures(List<MediaFeature>? features) async {
if (features == null || features.isEmpty) {
// We cannot use the generated client because sending null or omiting the
// value has different signification
await devTools.client
.send('Emulation.setEmulatedMedia', {'features': null});
} else {
await devTools.emulation.setEmulatedMedia(
features: features
.map((f) => protocol.MediaFeature(name: f.name, value: f.value))
.toList());
}
}