youtube_explode/lib/src/search/search_video.dart

47 lines
1.0 KiB
Dart
Raw Normal View History

import 'package:freezed_annotation/freezed_annotation.dart';
import '../common/common.dart';
2020-06-13 22:54:53 +02:00
import '../videos/video_id.dart';
2020-09-21 17:34:03 +02:00
import 'base_search_content.dart';
2020-06-13 22:54:53 +02:00
part 'search_video.freezed.dart';
2020-06-13 22:54:53 +02:00
/// Metadata related to a search query result (video).
@freezed
class SearchVideo with _$SearchVideo, BaseSearchContent {
/// Initialize a [SearchVideo] instance.
2022-02-28 12:26:56 +01:00
//@With<BaseSearchContent>()
const factory SearchVideo(
/// Video ID.
VideoId id,
2020-06-13 22:54:53 +02:00
/// Video title.
String title,
2020-06-13 22:54:53 +02:00
/// Video author.
String author,
2020-06-13 22:54:53 +02:00
/// Video description snippet. (Part of the full description if too long)
String description,
2020-06-13 22:54:53 +02:00
/// Video duration as String, HH:MM:SS
String duration,
2020-06-13 22:54:53 +02:00
/// Video View Count
int viewCount,
2021-02-27 18:58:42 +01:00
/// Video thumbnail
List<Thumbnail> thumbnails,
2021-02-27 18:58:42 +01:00
/// Video upload date - As string: 5 years ago.
String? uploadDate,
2020-09-23 08:27:23 +02:00
/// True if this video is a live stream.
2021-07-23 12:54:29 +02:00
// ignore: avoid_positional_boolean_parameters
bool isLive,
/// Channel id
String channelId,
) = _SearchVideo;
2020-06-13 22:54:53 +02:00
}