youtube_explode/lib/src/common/thumbnail_set.dart

39 lines
1.1 KiB
Dart
Raw Normal View History

import 'package:freezed_annotation/freezed_annotation.dart';
2020-02-24 14:28:52 +01:00
part 'thumbnail_set.freezed.dart';
2020-02-20 19:50:10 +01:00
/// Set of thumbnails for a video.
@freezed
class ThumbnailSet with _$ThumbnailSet {
2020-02-20 19:50:10 +01:00
/// Initializes an instance of [ThumbnailSet]
const factory ThumbnailSet(
/// Video id.
String videoId) = _ThumbnailSet;
const ThumbnailSet._();
2020-02-20 19:50:10 +01:00
/// Low resolution thumbnail URL.
String get lowResUrl => 'https://img.youtube.com/vi/$videoId/default.jpg';
/// Medium resolution thumbnail URL.
String get mediumResUrl =>
'https://img.youtube.com/vi/$videoId/mqdefault.jpg';
/// High resolution thumbnail URL.
String get highResUrl => 'https://img.youtube.com/vi/$videoId/hqdefault.jpg';
/// Standard resolution thumbnail URL.
/// Not always available.
String get standardResUrl =>
'https://img.youtube.com/vi/$videoId/sddefault.jpg';
/// Max resolution thumbnail URL.
/// Not always available.
String get maxResUrl =>
'https://img.youtube.com/vi/$videoId/maxresdefault.jpg';
2020-02-24 14:28:52 +01:00
@override
List<Object> get props => [videoId];
2020-02-20 19:50:10 +01:00
}