assignConst method Null safety

Expression assignConst(
  1. String name,
  2. [Reference? type]
)

Return const {name} = {this}.

Implementation

Expression assignConst(String name, [Reference? type]) => BinaryExpression._(
      type == null
          ? const LiteralExpression._('const')
          : BinaryExpression._(
              const LiteralExpression._('const'),
              type.expression,
              '',
            ),
      this,
      '$name =',
      isConst: true,
    );