From c99f8887ddf269f32c366a3e9c2e5b740ef788a5 Mon Sep 17 00:00:00 2001 From: Alex Demchenko Date: Mon, 8 Mar 2021 18:42:58 +0100 Subject: [PATCH] Fix null status --- CHANGELOG.md | 4 ++++ lib/src/message.dart | 6 +++--- pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bdfa9d..c0033c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.3 + +- Fix null status + ## 2.0.2 - Add CI diff --git a/lib/src/message.dart b/lib/src/message.dart index f0aaa28..1277bed 100644 --- a/lib/src/message.dart +++ b/lib/src/message.dart @@ -135,7 +135,7 @@ class FileMessage extends Message { super( json['authorId'] as String, json['id'] as String, - getStatusFromString(json['status'] as String), + getStatusFromString(json['status'] as String?), json['timestamp'] as int?, MessageType.file, ); @@ -255,7 +255,7 @@ class ImageMessage extends Message { super( json['authorId'] as String, json['id'] as String, - getStatusFromString(json['status'] as String), + getStatusFromString(json['status'] as String?), json['timestamp'] as int?, MessageType.image, ); @@ -348,7 +348,7 @@ class TextMessage extends Message { super( json['authorId'] as String, json['id'] as String, - getStatusFromString(json['status'] as String), + getStatusFromString(json['status'] as String?), json['timestamp'] as int?, MessageType.text, ); diff --git a/pubspec.yaml b/pubspec.yaml index 34e6ff2..48ae428 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: flutter_chat_types description: > Utility library for the flutter_chat_ui and flutter_firebase_chat_core libraries which contains shared type declarations. -version: 2.0.2 +version: 2.0.3 homepage: https://github.com/flyerhq/flutter_chat_types environment: