setEmulatedMedia method

Future<void> setEmulatedMedia({
  1. String? media,
  2. List<MediaFeature>? features,
})

Emulates the given media type or media feature for CSS media queries. media Media type to emulate. Empty string disables the override. features Media features to emulate.

Implementation

Future<void> setEmulatedMedia({
  String? media,
  List<MediaFeature>? features,
}) async {
  await _client.send('Emulation.setEmulatedMedia', {
    if (media != null) 'media': media,
    if (features != null) 'features': [...features],
  });
}