asInt property

int? get asInt

Implementation

int? get asInt {
  if (this is int) return this as int;
  try {
    return int.tryParse(toString());
  } catch (e) {
    return null;
  }
}