maybeGetSingleReturnExpression function
Expression?
maybeGetSingleReturnExpression(
- FunctionBody body
Implementation
Expression? maybeGetSingleReturnExpression(FunctionBody body) {
return switch (body) {
ExpressionFunctionBody(:final expression) ||
BlockFunctionBody(
block: Block(
statements: [
ReturnStatement(:final expression?),
],
)
) =>
expression,
_ => null,
};
}