fromJson static method

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

Implementation

static WatchPush fromJson(Map<String, Object?> json) => WatchPush(
  entryId: json['entryId'] as String?,
  frame: (json['frame'] as num?)?.toInt() ?? 0,
  nodes: (json['nodes'] as num?)?.toInt() ?? 0,
  hashMicros: (json['hashMicros'] as num?)?.toInt() ?? 0,
  structureChanged: json['structure'] == true,
  resized: json['resized'] == true,
  scrolled: json['scrolled'] == true,
  geometry: switch (json['geometry']) {
    Map box => WatchBox.fromJson(box.cast<String, Object?>()),
    _ => null,
  },
);