jsonDecodeAsList<T extends Object> function
json
decoding.
Only lists are output. If it is not a list, null is output.
If Json cannot be converted, defaultValue
will be returned.
Implementation
List<T> jsonDecodeAsList<T extends Object>(String json,
[List<T> defaultValue = const []]) {
try {
return (jsonDecode(json) as List).cast<T>();
// ignore: empty_catches
} catch (e) {}
return defaultValue;
}