optBoolean function
Calls through to {@link JSONObject#optInt(String)} only in the case that the key exists. This returns {@code null} if the key is not in the object.
@param jsonObject the input object @param fieldName the required field name @return the value stored in the requested field, or {@code null} if the key is not present
Implementation
bool optBoolean(Map<String, dynamic> json, String fieldName) {
return json[fieldName] ?? false;
}