SmsConversation.fromMap constructor

  1. @visibleForTesting
SmsConversation.fromMap(
  1. Map rawConversation
)

Do not call this method. This method is visible only for testing.

Implementation

@visibleForTesting
SmsConversation.fromMap(Map rawConversation) {
  final conversation =
      Map.castFrom<dynamic, dynamic, String, dynamic>(rawConversation);
  for (var column in DEFAULT_CONVERSATION_COLUMNS) {
    final String? value = conversation[column._columnName];
    switch (column._columnName) {
      case _ConversationProjections.SNIPPET:
        this.snippet = value;
        break;
      case _ConversationProjections.THREAD_ID:
        this.threadId = int.tryParse(value!);
        break;
      case _ConversationProjections.MSG_COUNT:
        this.messageCount = int.tryParse(value!);
        break;
    }
  }
}