CsMethodBody class
A method or accessor body of a generated declaration.
Constructors
-
CsMethodBody({required String name, required CsBodyShape shape, required CsLocation location, List<
CsCall> calls = const [], List<CsStatement> statements = const [], List<CsParameter> parameters = const [], String? returnType, String? thrownMessage, String? thrownType, bool isAsync = false}) -
Creates a method body.
const
Properties
-
allStatements
→ Iterable<
CsStatement> -
Every statement of the body, nested ones included.
no setter
-
calls
→ List<
CsCall> -
The call sites the body contains, in source order.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAsync → bool
-
Whether the method is declared
async/async*.final - isPseudoImplementation → bool
-
Whether this body is a pseudo-implementation —
codespecs_derivation_contract.md§2.4's form 3b, which is every body that is neither absent nor a lonethrow.no setter - location → CsLocation
-
Where the method is declared.
final
- name → String
-
The method name.
final
-
parameters
→ List<
CsParameter> -
The declared formal parameters, in source order.
final
- returnType → String?
-
The declared return type as written, or
nullwhen there is none.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape → CsBodyShape
-
What the body does.
final
-
statements
→ List<
CsStatement> -
The body's statements, in source order. Empty for a body-less method and
for a body shape the reader does not decompose.
final
- thrownMessage → String?
-
The literal argument of the
throw, when the body is a single throw of a constructor call with a string literal.nullwhen unreadable.final - thrownType → String?
-
The thrown type, when the body is a single throw of a constructor call.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited