Skip to content

Commit 477e64a

Browse files
committed
feat(lib): update video class member nullability
1 parent 9378a24 commit 477e64a

File tree

2 files changed

+43
-53
lines changed

2 files changed

+43
-53
lines changed

lib/src/types/video.dart

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ class Video {
4141
final String videoId;
4242

4343
/// When a video was created, presented in ISO-8601 format.
44-
final DateTime? createdAt;
44+
final DateTime createdAt;
4545

4646
/// The title of the video content.
47-
final String? title;
47+
final String title;
4848

4949
/// The description for the video content.
50-
final String? description;
50+
final String description;
5151

5252
/// The date and time the API created the video. Date and time are provided using ISO-8601 UTC format.
53-
final String? publishedAt;
53+
final String publishedAt;
5454

5555
/// The date and time the video was updated. Date and time are provided using ISO-8601 UTC format.
56-
final DateTime? updatedAt;
56+
final DateTime updatedAt;
5757

5858
/// The date and time the video was discarded.
5959
final DateTime? discardedAt;
@@ -62,7 +62,7 @@ class Video {
6262
final DateTime? deletesAt;
6363

6464
/// Returns `true` for videos you discarded.
65-
final bool? discarded;
65+
final bool discarded;
6666

6767
/// Returns the language of a video in [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
6868
@_JsonLocaleConverter()
@@ -72,50 +72,49 @@ class Video {
7272
final LanguageOrigin? languageOrigin;
7373

7474
/// One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces.
75-
final List<String>? tags;
75+
final List<String> tags;
7676

7777
/// Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata) allows you to define a key that allows any value pair.
78-
final List<Metadata>? metadata;
78+
final List<Metadata> metadata;
7979

8080
/// The source information about the video.
81-
final VideoSource? source;
81+
final VideoSource source;
8282

8383
/// The details about the video object that you can use to work with the video object.
84-
final VideoAssets? assets;
84+
final VideoAssets assets;
8585

8686
/// The id of the player that will be applied on the video.
8787
final String? playerId;
8888

8989
/// Defines if the content is publicly reachable or if a unique token is needed for each play session. Default is true. Tutorials on [private videos](https://api.video/blog/endpoints/private-videos).
90-
@JsonKey(name: '_public')
91-
final bool? public;
90+
final bool public;
9291

9392
/// Defines if video is panoramic.
94-
final bool? panoramic;
93+
final bool panoramic;
9594

9695
/// This lets you know whether mp4 is supported. If enabled, an mp4 URL will be provided in the response for the video.
97-
final bool? mp4Support;
96+
final bool mp4Support;
9897

9998
/// Creates a [Video].
10099
const Video(this.videoId,
101-
{this.createdAt,
102-
this.title,
103-
this.description,
104-
this.publishedAt,
105-
this.updatedAt,
100+
{required this.createdAt,
101+
required this.title,
102+
required this.description,
103+
required this.publishedAt,
104+
required this.updatedAt,
106105
this.discardedAt,
107106
this.deletesAt,
108-
this.discarded,
107+
required this.discarded,
109108
this.language,
110109
this.languageOrigin,
111-
this.tags,
112-
this.metadata,
113-
this.source,
114-
this.assets,
110+
required this.tags,
111+
required this.metadata,
112+
required this.source,
113+
required this.assets,
115114
this.playerId,
116-
this.public,
117-
this.panoramic,
118-
this.mp4Support});
115+
required this.public,
116+
required this.panoramic,
117+
required this.mp4Support});
119118

120119
/// Creates a [Video] from a [json] map.
121120
factory Video.fromJson(Map<String, dynamic> json) => _$VideoFromJson(json);

lib/src/types/video.g.dart

Lines changed: 17 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)