asInt method
Returns an int value given by section
and key
.
key
: the key of the (key value) pair
section
: if given the (key value) pair is searched in this section
defaultValue
: if the key does not exists this value is returned
Implementation
int? asInt(String key, {String? section, int? defaultValue}) {
var rc = defaultValue;
final value = asString(key,
section: section,
defaultValue: defaultValue == null ? null : defaultValue.toString());
if (value != null) {
rc = int.parse(value);
}
return rc;
}