getInt method

int getInt(
  1. String key, {
  2. int defaultValue = 0,
})

Implementation

int getInt(String key, {int defaultValue = 0}) {
  // 尝试将值转换为 int 类型
  return int.tryParse(this[key] ?? '') ?? defaultValue;
}