fromMap static method

Parses what the native side sends over the method channel. null when the map carries no post id.

Implementation

static AppwinCommunityPostTarget? fromMap(Map<Object?, Object?>? map) {
  final postId = map?['postId'];
  if (postId is! String) return null;
  final commentId = map?['commentId'];
  return AppwinCommunityPostTarget(
    postId: postId,
    commentId: commentId is String ? commentId : null,
  );
}