getDouble static method
Get the data.
key
: Key to get.
defaultValue
: Default value when there is no data.
Implementation
static double getDouble(String key, [double defaultValue = 0.0]) {
if (!isInitialized) {
debugPrint(
"It has not been initialized. Please initialize it by executing [initialize()].",
);
return 0.0;
}
if (!containsKey(key)) {
return defaultValue;
}
return _preferences?.getDouble(key) ?? defaultValue;
}