You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JsonObject factory accepts null, but will throw when null is passed #1242
the JsonObject factory accepts a nullable parameter, but if null is passed it will throw
/// Instantiates with [value], which must be a bool, a List, a Map, a num/// or a String. Otherwise, an [ArgumentError] is thrown.factoryJsonObject(Object? value) {
if (value isnum) {
returnNumJsonObject(value);
} elseif (value isString) {
returnStringJsonObject(value);
} elseif (value isbool) {
returnBoolJsonObject(value);
} elseif (value isList<Object?>) {
returnListJsonObject(value);
} elseif (value isMap<String, Object?>) {
returnMapJsonObject(value);
} elseif (value isMap) {
// Allow wrong type map, check individual values.returnMapJsonObject(value.cast());
} else {
throwArgumentError.value(value, 'value',
'Must be bool, List<Object?>, Map<String?, Object?>, num or String');
}
}
Activity
davidmorgan commentedon May 22, 2023
Thanks--I need to take another look at all the APIs to see if there are breaking changes worth making, I'll consider this one.