int readInt(dynamic json, String key) { dynamic result = json[key]; if (result == Null || result == null) { return 0; } return result as int; }