nullSafeCascadeIndex method

Expression nullSafeCascadeIndex(
  1. Expression index
)
inherited

Accesses the index operator ([]) on this via a null-aware cascade (?..).

Only the first cascade in a chain needs to use ?..; subsequent cascades in the same chain should use cascadeIndex or cascade.

Implementation

Expression nullSafeCascadeIndex(Expression index) => BinaryExpression._(
  this,
  CodeExpression(Block.of([const Code('['), index.code, const Code(']')])),
  '?..',
  addSpace: false,
);