arrayTransform method
FunctionExpression
arrayTransform(
- Object? transform(
- Expression element
- String alias = 'element',
This array with every element replaced by the result of transform.
transform is called once, with an expression that stands for the
current element; a result that is not an Expression is a constant.
field('prices').arrayTransform((price) => price.multiply(2));
alias is the name of the server-side variable that holds the element.
Implementation
FunctionExpression arrayTransform(
Object? Function(Expression element) transform, {
String alias = 'element',
}) {
return _function('array_transform', <Object?>[
alias,
toExpression(transform(VariableExpression(alias))),
]);
}