feat(llc, ui): add support for thumbUrl in video attachment. (#1362)

* feat(llc, ui): add support for thumbUrl in file attachment.

Signed-off-by: xsahil03x <[email protected]>

* chore(ui): use widget.fit instead of hardcoded fit.

Signed-off-by: xsahil03x <[email protected]>

* fix analysis

Signed-off-by: xsahil03x <[email protected]>
Co-authored-by: Salvatore Giordano <[email protected]>
This commit is contained in:
Sahil Kumar
2022-10-24 11:27:46 +02:00
committed by GitHub
co-authored by Salvatore Giordano
parent 8b6c59929f
commit 1e9e942c46
11 changed files with 101 additions and 65 deletions
@@ -157,11 +157,24 @@ class ListDevicesResponse extends _BaseResponse {
_$ListDevicesResponseFromJson(json);
}
/// Base Model response for [Channel.sendImage] and [Channel.sendFile] api call.
@JsonSerializable(createToJson: false)
class SendAttachmentResponse extends _BaseResponse {
/// The url of the uploaded attachment.
late String? file;
/// Create a new instance from a json
static SendAttachmentResponse fromJson(Map<String, dynamic> json) =>
_$SendAttachmentResponseFromJson(json);
}
/// Model response for [Channel.sendFile] api call
@JsonSerializable(createToJson: false)
class SendFileResponse extends _BaseResponse {
/// The url of the uploaded file
late String file;
class SendFileResponse extends SendAttachmentResponse {
/// The url of the uploaded video file.
///
/// This is only present if the file is a video.
String? thumbUrl;
/// Create a new instance from a json
static SendFileResponse fromJson(Map<String, dynamic> json) =>
@@ -169,15 +182,7 @@ class SendFileResponse extends _BaseResponse {
}
/// Model response for [Channel.sendImage] api call
@JsonSerializable(createToJson: false)
class SendImageResponse extends _BaseResponse {
/// The url of the uploaded file
late String file;
/// Create a new instance from a json
static SendImageResponse fromJson(Map<String, dynamic> json) =>
_$SendImageResponseFromJson(json);
}
typedef SendImageResponse = SendAttachmentResponse;
/// Model response for [Channel.sendReaction] api call
@JsonSerializable(createToJson: false)
@@ -97,15 +97,17 @@ ListDevicesResponse _$ListDevicesResponseFromJson(Map<String, dynamic> json) =>
.toList() ??
[];
SendAttachmentResponse _$SendAttachmentResponseFromJson(
Map<String, dynamic> json) =>
SendAttachmentResponse()
..duration = json['duration'] as String?
..file = json['file'] as String?;
SendFileResponse _$SendFileResponseFromJson(Map<String, dynamic> json) =>
SendFileResponse()
..duration = json['duration'] as String?
..file = json['file'] as String;
SendImageResponse _$SendImageResponseFromJson(Map<String, dynamic> json) =>
SendImageResponse()
..duration = json['duration'] as String?
..file = json['file'] as String;
..file = json['file'] as String?
..thumbUrl = json['thumb_url'] as String?;
SendReactionResponse _$SendReactionResponseFromJson(
Map<String, dynamic> json) =>