WatchUser.fromJson constructor

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

Implementation

factory WatchUser.fromJson(Map<String, Object?> json) {
  return WatchUser(
    type: json[r'type'] as String? ?? '',
    username: json[r'username'] as String?,
    userKey: json[r'userKey'] as String?,
    accountId: json[r'accountId'] as String? ?? '',
    profilePicture: Icon.fromJson(
        json[r'profilePicture'] as Map<String, Object?>? ?? const {}),
    displayName: json[r'displayName'] as String? ?? '',
    timeZone: json[r'timeZone'] as String?,
    operations: (json[r'operations'] as List<Object?>?)
            ?.map((i) => OperationCheckResult.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    isExternalCollaborator: json[r'isExternalCollaborator'] as bool? ?? false,
    details: json[r'details'] != null
        ? UserDetails.fromJson(json[r'details']! as Map<String, Object?>)
        : null,
    accountType: json[r'accountType'] as String? ?? '',
    email: json[r'email'] as String? ?? '',
    publicName: json[r'publicName'] as String? ?? '',
    personalSpace: json[r'personalSpace'] as Map<String, Object?>? ?? {},
    externalCollaborator: json[r'externalCollaborator'] as bool? ?? false,
  );
}