ScreenInfo.fromJson constructor

ScreenInfo.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ScreenInfo.fromJson(Map<String, dynamic> json) {
  return ScreenInfo(
    left: json['left'] as int,
    top: json['top'] as int,
    width: json['width'] as int,
    height: json['height'] as int,
    availLeft: json['availLeft'] as int,
    availTop: json['availTop'] as int,
    availWidth: json['availWidth'] as int,
    availHeight: json['availHeight'] as int,
    devicePixelRatio: json['devicePixelRatio'] as num,
    orientation: ScreenOrientation.fromJson(
      json['orientation'] as Map<String, dynamic>,
    ),
    colorDepth: json['colorDepth'] as int,
    isExtended: json['isExtended'] as bool? ?? false,
    isInternal: json['isInternal'] as bool? ?? false,
    isPrimary: json['isPrimary'] as bool? ?? false,
    label: json['label'] as String,
    id: ScreenId.fromJson(json['id'] as String),
  );
}