getInt abstract method

int getInt({
  1. required String key,
  2. int defaultValue = -1,
})

Returns the int value associated with the key, otherwise defaultValue.

If key does not exist in the JSON object, or if there is a specific default value that you want to return when the value associated with key is null, set it to the argument defaultValue.

Implementation

int getInt({
  required String key,
  int defaultValue = -1,
});