toJson method

  1. @override
Map<String, dynamic> toJson()
override

Returns the json representation of this model in the unsplash api.

Implementation

@override
Map<String, dynamic> toJson() {
  return <String, dynamic>{
    'id': id,
    'updated_at': updatedAt.toIso8601String(),
    'username': username,
    'name': name,
    'first_name': firstName,
    'last_name': lastName,
    'email': email,
    'uploads_remaining': uploadsRemaining,
    'portfolio_url': portfolioUrl.toString(),
    'bio': bio,
    'location': location,
    'total_likes': totalLikes,
    'total_photos': totalPhotos,
    'total_collections': totalCollections,
    'followed_by_user': followedByUser,
    'follower_count': followerCount,
    'following_count': followingCount,
    'downloads': downloads,
    'instagram_username': instagramUsername,
    'twitter_username': twitterUsername,
    'profile_image': profileImage.toJson(),
    'badge': badge?.toJson(),
    'links': links.toJson(),
  };
}