asListStringOrNull function
==================== ListString conversions
Returns a List if the value at key is a list of strings, otherwise null.
Implementation
/// Returns a List if the value at [key] is a list of strings, otherwise null.
List<String>? asListStringOrNull(dynamic json, String key,
{String Function(dynamic json)? fromJson}) {
final list = asListOrNull<dynamic>(json, key, fromJson: fromJson)
?.map(toStringOrNull)
.toList();
if (list == null || list.any((element) => element == null)) return null;
return list.whereType<String>().toList();
}