decodeIntOrNull method

  1. @override
int? decodeIntOrNull()
override

Decodes the data as a nullable integer value.

Implementation

@override
int? decodeIntOrNull() {
  try {
    return (_value as num?)?.toInt();
  } on TypeError {
    throw CodableException.unexpectedType(expected: 'int?', actual: '${_value.runtimeType}', data: _value);
  }
}