text property

String? get text

Implementation

String? get text {
  if (!isTextMessage || content.isEmpty) {
    return null;
  }
  try {
    final decoded = jsonDecode(content);
    if (decoded is Map) {
      final value = decoded['content'];
      return value == null ? '' : value.toString();
    }
  } catch (_) {
    return null;
  }
  return null;
}