Expression class Null safety
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.
read-only
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- isConst → bool
-
Whether this expression implies a const context for sub expressions.
read-only
- nullChecked → Expression
-
Applies the null check operator on this expression, returning
this
!
.read-only - nullSafeSpread → Expression
-
This expression precenede by the null safe spread operator
?...
.read-only - returned → Expression
-
This expression preceded by
return
.read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- spread → Expression
-
This expression preceded by the spread operator
...
.read-only - statement → Code
-
The expression as a valid Code block with a trailing
;
.read-only - thrown → Expression
-
This expression preceded by
throw
.read-only
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
{this} = {other}
. -
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
{this} ??= {other}
. -
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.
-
cascade(
String name) → Expression -
Returns an expression accessing
..<name>
on this expression. -
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
. -
ifNullThen(
Expression other) → Expression -
Return
{this} ?? {other}
. -
index(
Expression index) → Expression -
Returns accessing the index operator (
[]
) onthis
. -
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
. -
negate(
) → Expression -
Returns the result of
!this
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
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
. -
or(
Expression other) → Expression -
Returns the result of
this
||
other
. -
property(
String name) → Expression -
Returns an expression accessing
.<name>
on this expression. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited