Merge branch 'develop' into feature/null-safety
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
## 1.5.1
|
||||
|
||||
- Minor fixes and improvements
|
||||
|
||||
## 1.5.0
|
||||
|
||||
- Minor fixes and improvements
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
[](https://pub.dartlang.org/packages/stream_chat)
|
||||

|
||||
[](https://gitter.im/GetStream/stream-chat-flutter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||

|
||||
|
||||
**Quick Links**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// ignore_for_file: public_member_api_docs
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:stream_chat/src/models/action.dart';
|
||||
import 'package:stream_chat/src/models/attachment_file.dart';
|
||||
@@ -10,7 +11,7 @@ part 'attachment.g.dart';
|
||||
|
||||
/// The class that contains the information about an attachment
|
||||
@JsonSerializable(includeIfNull: false)
|
||||
class Attachment {
|
||||
class Attachment extends Equatable {
|
||||
/// Constructor used for json serialization
|
||||
Attachment({
|
||||
String id,
|
||||
@@ -37,12 +38,11 @@ class Attachment {
|
||||
UploadState uploadState,
|
||||
}) : id = id ?? const Uuid().v4(),
|
||||
title = title ?? file?.name,
|
||||
localUri = file?.path != null ? Uri.parse(file.path) : null {
|
||||
this.uploadState = uploadState ??
|
||||
((assetUrl != null || imageUrl != null)
|
||||
? const UploadState.success()
|
||||
: const UploadState.preparing());
|
||||
}
|
||||
localUri = file?.path != null ? Uri.parse(file.path) : null,
|
||||
uploadState = uploadState ??
|
||||
((assetUrl != null || imageUrl != null)
|
||||
? const UploadState.success()
|
||||
: const UploadState.preparing());
|
||||
|
||||
/// Create a new instance from a json
|
||||
factory Attachment.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -104,7 +104,7 @@ class Attachment {
|
||||
final AttachmentFile file;
|
||||
|
||||
/// The current upload state of the attachment
|
||||
UploadState uploadState;
|
||||
final UploadState uploadState;
|
||||
|
||||
/// Map of custom channel extraData
|
||||
@JsonKey(includeIfNull: false)
|
||||
@@ -205,49 +205,28 @@ class Attachment {
|
||||
);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is Attachment &&
|
||||
runtimeType == other.runtimeType &&
|
||||
type == other.type &&
|
||||
titleLink == other.titleLink &&
|
||||
title == other.title &&
|
||||
thumbUrl == other.thumbUrl &&
|
||||
text == other.text &&
|
||||
pretext == other.pretext &&
|
||||
ogScrapeUrl == other.ogScrapeUrl &&
|
||||
imageUrl == other.imageUrl &&
|
||||
footerIcon == other.footerIcon &&
|
||||
footer == other.footer &&
|
||||
fields == other.fields &&
|
||||
fallback == other.fallback &&
|
||||
color == other.color &&
|
||||
authorName == other.authorName &&
|
||||
authorLink == other.authorLink &&
|
||||
authorIcon == other.authorIcon &&
|
||||
assetUrl == other.assetUrl &&
|
||||
actions == other.actions &&
|
||||
extraData == other.extraData;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
type.hashCode ^
|
||||
titleLink.hashCode ^
|
||||
title.hashCode ^
|
||||
thumbUrl.hashCode ^
|
||||
text.hashCode ^
|
||||
pretext.hashCode ^
|
||||
ogScrapeUrl.hashCode ^
|
||||
imageUrl.hashCode ^
|
||||
footerIcon.hashCode ^
|
||||
footer.hashCode ^
|
||||
fields.hashCode ^
|
||||
fallback.hashCode ^
|
||||
color.hashCode ^
|
||||
authorName.hashCode ^
|
||||
authorLink.hashCode ^
|
||||
authorIcon.hashCode ^
|
||||
assetUrl.hashCode ^
|
||||
actions.hashCode ^
|
||||
extraData.hashCode;
|
||||
List<Object> get props => [
|
||||
id,
|
||||
type,
|
||||
titleLink,
|
||||
title,
|
||||
thumbUrl,
|
||||
text,
|
||||
pretext,
|
||||
ogScrapeUrl,
|
||||
imageUrl,
|
||||
footerIcon,
|
||||
footer,
|
||||
fields,
|
||||
fallback,
|
||||
color,
|
||||
authorName,
|
||||
authorLink,
|
||||
authorIcon,
|
||||
assetUrl,
|
||||
actions,
|
||||
file,
|
||||
uploadState,
|
||||
extraData,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:stream_chat/src/models/attachment.dart';
|
||||
import 'package:stream_chat/src/models/reaction.dart';
|
||||
@@ -41,7 +42,7 @@ enum MessageSendingStatus {
|
||||
|
||||
/// The class that contains the information about a message
|
||||
@JsonSerializable()
|
||||
class Message {
|
||||
class Message extends Equatable {
|
||||
/// Constructor used for json serialization
|
||||
Message({
|
||||
String id,
|
||||
@@ -345,6 +346,39 @@ class Message {
|
||||
pinnedBy: other.pinnedBy,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object> get props => [
|
||||
id,
|
||||
text,
|
||||
type,
|
||||
attachments,
|
||||
mentionedUsers,
|
||||
reactionCounts,
|
||||
reactionScores,
|
||||
latestReactions,
|
||||
ownReactions,
|
||||
parentId,
|
||||
quotedMessage,
|
||||
quotedMessageId,
|
||||
replyCount,
|
||||
threadParticipants,
|
||||
showInChannel,
|
||||
shadowed,
|
||||
silent,
|
||||
command,
|
||||
createdAt,
|
||||
updatedAt,
|
||||
deletedAt,
|
||||
user,
|
||||
pinned,
|
||||
pinnedAt,
|
||||
pinExpires,
|
||||
pinnedBy,
|
||||
extraData,
|
||||
status,
|
||||
skipPush,
|
||||
];
|
||||
}
|
||||
|
||||
/// A translated message
|
||||
|
||||
@@ -15,6 +15,7 @@ export './src/attachment_file_uploader.dart' show AttachmentFileUploader;
|
||||
export './src/client.dart';
|
||||
export './src/db/chat_persistence_client.dart';
|
||||
export './src/event_type.dart';
|
||||
export './src/exceptions.dart';
|
||||
export './src/extensions/rate_limit.dart';
|
||||
export './src/extensions/string_extension.dart';
|
||||
export './src/models/action.dart';
|
||||
|
||||
@@ -3,4 +3,4 @@ import 'package:stream_chat/src/client.dart';
|
||||
/// Current package version
|
||||
/// Used in [StreamChatClient] to build the `x-stream-client` header
|
||||
// ignore: constant_identifier_names
|
||||
const PACKAGE_VERSION = '1.5.0';
|
||||
const PACKAGE_VERSION = '1.5.1';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: stream_chat
|
||||
homepage: https://getstream.io/
|
||||
description: The official Dart client for Stream Chat, a service for building chat applications.
|
||||
version: 1.5.0
|
||||
version: 1.5.1
|
||||
repository: https://github.com/GetStream/stream-chat-flutter
|
||||
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
||||
|
||||
|
||||
Reference in New Issue
Block a user