Message.fromJsonString constructor

Message.fromJsonString(
  1. String jsonString
)

Implementation

factory Message.fromJsonString(String jsonString) {
  final value = jsonDecode(jsonString);
  if (value is! Map<String, Object?>) {
    throw FormatException('Expected a message JSON object.', jsonString);
  }
  return Message.fromJson(value);
}