updateScreen method
Updates specified screen parameters. Only supported in headless mode.
screenId Target screen identifier.
left Offset of the left edge of the screen in pixels.
top Offset of the top edge of the screen in pixels.
width The width of the screen in pixels.
height The height of the screen in pixels.
workAreaInsets Specifies the screen's work area.
devicePixelRatio Specifies the screen's device pixel ratio.
rotation Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270.
colorDepth Specifies the screen's color depth in bits.
label Specifies the descriptive label for the screen.
isInternal Indicates whether the screen is internal to the device or external, attached to the device. Default is false.
Implementation
Future<ScreenInfo> updateScreen(
ScreenId screenId, {
int? left,
int? top,
int? width,
int? height,
WorkAreaInsets? workAreaInsets,
num? devicePixelRatio,
int? rotation,
int? colorDepth,
String? label,
bool? isInternal,
}) async {
var result = await _client.send('Emulation.updateScreen', {
'screenId': screenId,
if (left != null) 'left': left,
if (top != null) 'top': top,
if (width != null) 'width': width,
if (height != null) 'height': height,
if (workAreaInsets != null) 'workAreaInsets': workAreaInsets,
if (devicePixelRatio != null) 'devicePixelRatio': devicePixelRatio,
if (rotation != null) 'rotation': rotation,
if (colorDepth != null) 'colorDepth': colorDepth,
if (label != null) 'label': label,
if (isInternal != null) 'isInternal': isInternal,
});
return ScreenInfo.fromJson(result['screenInfo'] as Map<String, dynamic>);
}