parseComparable<T> function

Comparable<T>? parseComparable<T>(
  1. Object? v
)

Parses v as to a Comparable type.

Implementation

Comparable<T>? parseComparable<T>(Object? v) {
  if (v == null) return null;
  if (v is num) return v as Comparable<T>;

  if (v is String) return v as Comparable<T>;

  return parseString(v) as Comparable<T>?;
}