getInt method
Returns a session value as int by key
. Returns defaultVal
if the
conversion fails.
Implementation
int? getInt(String key, [int? defaultVal]) {
final String? val = _data[key];
if (val == null) {
return defaultVal;
}
return int.tryParse(val) ?? defaultVal;
}