getNum method
获取缓存num
key
cache key
Implementation
num getNum(String key) {
dynamic value = get(key);
if (value == null) {
return 0;
}
try {
if (value is num) {
return value ~/ 1;
} else {
return (num.tryParse("$value") ?? 0) ~/ 1;
}
} catch (e) {
return 0;
}
}