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