SearchResult class abstract

Defines a result returned by a search query.

May be a TrackSearchResult, PlaylistSearchResult, or UserSearchResult.

Implementers
Annotations
  • @freezed

Constructors

SearchResult.fromJson(Map<String, Object?> json)
factory
SearchResult.playlist({required Uri? artworkUrl, required DateTime createdAt, required String? description, required double duration, required String? genre, required int id, required String? labelName, required DateTime? lastModified, @JsonKey(defaultValue: 0) required double likesCount, required Uri permalinkUrl, @JsonKey(defaultValue: 0) required double repostsCount, required String? tagList, required String title, required bool isAlbum, required MiniUser user, @JsonKey(defaultValue: 0) required double trackCount})
const
factory
SearchResult.track({required Uri? artworkUrl, required String? caption, required bool commentable, @JsonKey(defaultValue: 0) required double commentCount, required DateTime createdAt, required String? description, @JsonKey(defaultValue: 0) required double downloadCount, required double duration, required double fullDuration, required String? genre, required int id, required String? labelName, required DateTime? lastModified, required String? license, @JsonKey(defaultValue: 0) required double likesCount, required Uri permalinkUrl, @JsonKey(defaultValue: 0) required double playbackCount, required String? purchaseTitle, required String? purchaseUrl, @JsonKey(defaultValue: 0) required double repostsCount, required String? tagList, required String title, required String waveformUrl, required String monetizationModel, required String policy, required MiniUser user})
const
factory
SearchResult.user({required Uri? avatarUrl, @JsonKey(readValue: _readBannerLink) required Uri? bannerLink, @JsonKey(readValue: _readBannerUrl) required Uri? bannerUrl, required String? city, @JsonKey(defaultValue: 0) required double commentsCount, required String? countryCode, required DateTime createdAt, required String? description, required double followersCount, required double followingsCount, required String? firstName, required String? fullName, @JsonKey(defaultValue: 0) required double groupsCount, required int id, required DateTime? lastModified, required String? lastName, @JsonKey(defaultValue: 0) required double likesCount, @JsonKey(defaultValue: 0) required double playlistLikesCount, required Uri permalinkUrl, @JsonKey(defaultValue: 0) required double playlistCount, @JsonKey(defaultValue: 0) required double repostsCount, @JsonKey(defaultValue: 0) required double trackCount, required String username, @JsonKey(name: 'verified') required bool isVerified})
const
factory

Properties

copyWith → $SearchResultCopyWith<SearchResult>
Create a copy of SearchResult with the given fields replaced by the non-null parameter values.
no setterinherited
createdAt DateTime
no setterinherited
description String?
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id int
no setterinherited
lastModified DateTime?
no setterinherited
likesCount double
no setterinherited
permalinkUrl Uri
no setterinherited
repostsCount double
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>({required TResult track(TrackSearchResult value), required TResult playlist(PlaylistSearchResult value), required TResult user(UserSearchResult value)}) → TResult
inherited
mapOrNull<TResult extends Object?>({TResult? track(TrackSearchResult value)?, TResult? playlist(PlaylistSearchResult value)?, TResult? user(UserSearchResult value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult track(TrackSearchResult value)?, TResult playlist(PlaylistSearchResult value)?, TResult user(UserSearchResult value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult track(Uri? artworkUrl, String? caption, bool commentable, double commentCount, DateTime createdAt, String? description, double downloadCount, double duration, double fullDuration, String? genre, int id, String? labelName, DateTime? lastModified, String? license, double likesCount, Uri permalinkUrl, double playbackCount, String? purchaseTitle, String? purchaseUrl, double repostsCount, String? tagList, String title, String waveformUrl, String monetizationModel, String policy, MiniUser user)?, TResult playlist(Uri? artworkUrl, DateTime createdAt, String? description, double duration, String? genre, int id, String? labelName, DateTime? lastModified, double likesCount, Uri permalinkUrl, double repostsCount, String? tagList, String title, bool isAlbum, MiniUser user, double trackCount)?, TResult user(Uri? avatarUrl, Uri? bannerLink, Uri? bannerUrl, String? city, double commentsCount, String? countryCode, DateTime createdAt, String? description, double followersCount, double followingsCount, String? firstName, String? fullName, double groupsCount, int id, DateTime? lastModified, String? lastName, double likesCount, double playlistLikesCount, Uri permalinkUrl, double playlistCount, double repostsCount, double trackCount, String username, bool isVerified)?, required TResult orElse()}) → TResult
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this SearchResult to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult track(Uri? artworkUrl, String? caption, bool commentable, double commentCount, DateTime createdAt, String? description, double downloadCount, double duration, double fullDuration, String? genre, int id, String? labelName, DateTime? lastModified, String? license, double likesCount, Uri permalinkUrl, double playbackCount, String? purchaseTitle, String? purchaseUrl, double repostsCount, String? tagList, String title, String waveformUrl, String monetizationModel, String policy, MiniUser user), required TResult playlist(Uri? artworkUrl, DateTime createdAt, String? description, double duration, String? genre, int id, String? labelName, DateTime? lastModified, double likesCount, Uri permalinkUrl, double repostsCount, String? tagList, String title, bool isAlbum, MiniUser user, double trackCount), required TResult user(Uri? avatarUrl, Uri? bannerLink, Uri? bannerUrl, String? city, double commentsCount, String? countryCode, DateTime createdAt, String? description, double followersCount, double followingsCount, String? firstName, String? fullName, double groupsCount, int id, DateTime? lastModified, String? lastName, double likesCount, double playlistLikesCount, Uri permalinkUrl, double playlistCount, double repostsCount, double trackCount, String username, bool isVerified)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult? track(Uri? artworkUrl, String? caption, bool commentable, double commentCount, DateTime createdAt, String? description, double downloadCount, double duration, double fullDuration, String? genre, int id, String? labelName, DateTime? lastModified, String? license, double likesCount, Uri permalinkUrl, double playbackCount, String? purchaseTitle, String? purchaseUrl, double repostsCount, String? tagList, String title, String waveformUrl, String monetizationModel, String policy, MiniUser user)?, TResult? playlist(Uri? artworkUrl, DateTime createdAt, String? description, double duration, String? genre, int id, String? labelName, DateTime? lastModified, double likesCount, Uri permalinkUrl, double repostsCount, String? tagList, String title, bool isAlbum, MiniUser user, double trackCount)?, TResult? user(Uri? avatarUrl, Uri? bannerLink, Uri? bannerUrl, String? city, double commentsCount, String? countryCode, DateTime createdAt, String? description, double followersCount, double followingsCount, String? firstName, String? fullName, double groupsCount, int id, DateTime? lastModified, String? lastName, double likesCount, double playlistLikesCount, Uri permalinkUrl, double playlistCount, double repostsCount, double trackCount, String username, bool isVerified)?}) → TResult?
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited