asInt function

int? asInt(
  1. Object? value
)

Implementation

int? asInt(Object? value) => value is int ? value : (value is double && value == value.truncateToDouble() ? value.toInt() : null);