i method
获取 value 转 int
Implementation
int i(String key, [int defaultValue = 0]) {
final value = this[key];
if (value is int) return value;
if (value is double) return value.toInt();
if (value == null) {
XLog.d('$key=null => int:$defaultValue');
return defaultValue;
}
final other = int.tryParse(value.toString()) ?? defaultValue;
XLog.d('${value.runtimeType} $key=$value => int:$other');
return other;
}