Screen.fromJson constructor Null safety

Screen.fromJson(
  1. Map<String, Object?> json
)

Named constructor to create Screen from a Map.

Implementation

Screen.fromJson(Map<String, Object?> json)
    : this(
        pairingCode: json['pairingCode']! as String,
        paired: json['paired']! as bool,
        name: json['name']! as String,
        userID: json['userID']! as String,
        lastUpdated: DateTime.parse(
            (json['lastUpdated']! as Timestamp).toDate().toString()),
        screenToken: json['screenToken']! as String,
        width: (json['width']! as num).toDouble(),
        height: (json['height']! as num).toDouble(),
      );