Expression class

Represents a code block that wraps an Expression. Represents a Dart expression.

See various concrete implementations for details.

Implemented types
Implementers

Constructors

Expression()
const

Properties

awaited Expression
This expression preceded by await.
read-only
code Code
The expression as a valid Code block. [...]
read-only
expression Expression
May be overridden to support other types implementing Expression.
@visibleForOverriding, read-only
returned Expression
This expression preceded by return.
read-only
statement Code
The expression as a valid Code block with a trailing ;.
read-only
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

accept<R>(covariant ExpressionVisitor<R> visitor, [ R context ]) → R
override
and(Expression other) Expression
Returns the result of this && other.
asA(Expression other) Expression
Returns the result of this as other.
assign(Expression other) Expression
Return {other} = {this}.
assignConst(String name, [ Reference type ]) Expression
Return const {name} = {this}.
assignFinal(String name, [ Reference type ]) Expression
Return final {name} = {this}.
assignNullAware(Expression other) Expression
Return {other} ??= {this}.
assignVar(String name, [ Reference type ]) Expression
Return var {name} = {this}.
call(Iterable<Expression> positionalArguments, [ Map<String, Expression> namedArguments = const {}, List<Reference> typeArguments = const [] ]) Expression
Call this expression as a method.
conditional(Expression whenTrue, Expression whenFalse) Expression
equalTo(Expression other) Expression
Returns the result of this == other.
greaterOrEqualTo(Expression other) Expression
Returns the result of this >= other.
greaterThan(Expression other) Expression
Returns the result of this > other.
index(Expression index) Expression
Returns accessing the index operator ([]) on this.
isA(Expression other) Expression
Returns the result of this is other.
isNotA(Expression other) Expression
Returns the result of this is! other.
lessOrEqualTo(Expression other) Expression
Returns the result of this <= other.
lessThan(Expression other) Expression
Returns the result of this < other.
notEqualTo(Expression other) Expression
Returns the result of this != other.
nullSafeProperty(String name) Expression
Returns an expression accessing ?.<name> on this expression.
operatorAdd(Expression other) Expression
Returns the result of this + other.
operatorDivide(Expression other) Expression
Returns the result of this / other.
operatorEuclideanModulo(Expression other) Expression
Returns the result of this % other.
operatorMultiply(Expression other) Expression
Returns the result of this * other.
operatorSubstract(Expression other) Expression
Returns the result of this - other.
property(String name) Expression
Returns an expression accessing .<name> on this expression.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited