RankBy$cast function Null safety

RankBy? RankBy$cast(
  1. dynamic value
)

Implementation

RankBy? RankBy$cast(value) {
  if (value == RankBy.DISTANCE) return RankBy.DISTANCE;
  if (value == RankBy.PROMINENCE) return RankBy.PROMINENCE;
  return null;
}