getDouble method

double? getDouble(
  1. String key, [
  2. double? defaultVal
])

Returns a session value as double by key. Returns defaultVal if the conversion fails.

Implementation

double? getDouble(String key, [double? defaultVal]) {
  final String? val = _data[key];

  if (val == null) {
    return defaultVal;
  }

  return double.tryParse(val) ?? defaultVal;
}