asInt method

int asInt()

Decode value to int.

Implementation

int asInt() {
  final value = _value;
  if (value != null) {
    final String strValue = const Utf8Codec().decode(value);
    final int intValue = int.tryParse(strValue) ?? defaultValueForInt;
    return intValue;
  } else {
    return defaultValueForInt;
  }
}