fromJson static method

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

Implementation

static SharedUser? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return SharedUser(
    userId: (json['user_id'] as int?) ?? 0,
    firstName: json['first_name'] as String?,
    lastName: json['last_name'] as String?,
    username: json['username'] as String?,
    photo: Photo.fromJson(json['photo'] as Map<String, dynamic>?),
  );
}