Expression class

An Expression is a syntactic entity in the Dart programming language that may be evaluated to determine its value e.g.: 1 or or 1.1 or 1+2 or 'hello' or 'hello' + ' world' or user.name See: https://dart.dev/guides/language/language-tour#operators

Inheritance

Constructors

Expression(List<CodeNode> nodes)
========================================================================= CONSTRUCTORS
Expression.betweenParentheses(Expression expression)
Expression.callConstructor(Type type, {String? name, ParameterValues? parameterValues, bool isConst = false})
Expression.callMethodOrFunction(String name, {String? libraryUri, ParameterValues? parameterValues})
A call to a method in the same class or a function
Expression.ofBool(bool value)
Expression.ofDateTime(DateTime value)
Expression.ofDouble(double value)
Expression.ofEnum(Type type, String value)
Expression.ofInt(int value)
Expression.ofList(List<Expression> expressions)
Expression.ofMap(Map<Expression, Expression> expressions)
Expression.ofNull()
Expression.ofSet(Set<Expression> expressions)
Expression.ofString(String value)
Expression.ofSuper()
Expression.ofSuperField(String name)
Expression.ofThis()
Expression.ofThisField(String name)
Expression.ofType(Type type)
Expression.ofVariable(String name)

Properties

hashCode int
The hash code for this object.
no setterinherited
nodes List<CodeNode>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(Expression other) Expression
Returns the result of this + other.
and(Expression other) Expression
========================================================================= OPERATORS AS FLUENT METHODS
asA(Type otherType) Expression
Returns the result of this as other.
assertNull() Expression
Return '{this}!'
assignVariable(String name, {dynamic nullAware = false}) Statement
awaited() Expression
This expression preceded by await.
callMethod(String name, {ParameterValues? parameterValues, bool cascade = false, bool ifNullReturnNull = false}) Expression
=========================================================================== OTHER FLUENT METHODS
codeNodes(Context context) List<CodeNode>
=========================================================================== codeNodes
override
conditional(Expression whenTrue, Expression whenFalse) Expression
Return {this} ? {whenTrue} : {whenFalse}.
decrement({dynamic after = true}) Expression
Returns the result of this-- or --this.
defineVariable(String name, {List<DocComment> docComments = const [], List<Annotation> annotations = const [], bool static = false, Modifier modifier = Modifier.var$, Type? type, Expression? value}) Statement
divide(Expression other) Expression
Returns the result of this / other.
equalTo(Expression other) Expression
Returns the result of this == other.
getProperty(String name, {bool cascade = false, bool ifNullReturnNull = false}) Expression
greaterOrEqualTo(Expression other) Expression
Returns the result of this >= other.
greaterThan(Expression other) Expression
Returns the result of this > other.
ifNull(Expression alternativeWhenNull) Expression
Return {this} ?? {alternativeWhenNull} '.
increment({dynamic after = true}) Expression
Returns the result of this++ or ++this.
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.
modulo(Expression other) Expression
Returns the result of this % other.
multiply(Expression other) Expression
Returns the result of this * other.
negate() Expression
Returns the result of !this.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notEqualTo(Expression other) Expression
Returns the result of this != other.
or(Expression other) Expression
Returns the result of this || other.
setProperty(String name, Expression value, {bool cascade = false}) Expression
subtract(Expression other) Expression
Returns the result of this - other.
toString() String
A string representation of this object.
inherited
toUnFormattedString(Context context) String
Recursive call to get the unformatted code from all nodes
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited