convertToIntIfDoubleValue function

int? convertToIntIfDoubleValue(
  1. dynamic jsonValue
)

Helper function to overcome the current spotify bug

Implementation

int? convertToIntIfDoubleValue(dynamic jsonValue) {
  if (jsonValue is num) {
    return jsonValue.toInt();
  }
  return null;
}