mapAndRemoveEmpty<TCast> method
Each element of the list is converted to TCast
data using callback
.
If the return value of callback
is Null, the element is removed from the element.
It is returned as a List type, not as a Iterable type like map.
リストの各要素をcallback
を用いTCast
のデータに変換します。
callback
の戻り値がNullの場合、要素から削除されます。
Implementation
List<TCast> mapAndRemoveEmpty<TCast>(TCast? Function(T item) callback) {
return map<TCast?>(callback).removeEmpty();
}