super_annotations library Null safety

Classes

Allocator
Collects references and automatically allocates prefixes and imports.
BinaryExpression
Represents two expressions (left and right) and an operator.
Block
Represents blocks of statements of Dart code.
BlockBuilder
Class
ClassAnnotation
Extend this to create a custom annotation for classes
ClassBuilder
Code
Represents arbitrary Dart code (either expressions or statements).
CodeExpression
Represents a Code block as an Expression.
CodeGen
Constructor
ConstructorBuilder
DartEmitter
Directive
DirectiveBuilder
Enum
EnumAnnotation
Extend this to create a custom annotation for enums
EnumBuilder
EnumValue
EnumValueBuilder
EqualsDart
Implementation detail of using the equalsDart matcher.
Expression
Represents a code block that wraps an Expression. Represents a Dart expression.
ExpressionEmitter
Knowledge of how to write valid Dart code from ExpressionVisitor.
ExpressionVisitor<T>
Knowledge of different types of expressions in Dart.
Extension
ExtensionBuilder
Field
FieldBuilder
FunctionAnnotation
Extend this to create a custom annotation for functions
FunctionType
FunctionTypeBuilder
InvokeExpression
Represents invoking target as a method with arguments.
Library
LibraryBuilder
LiteralExpression
Represents a literal value in Dart source code.
LiteralListExpression
Method
MethodBuilder
Mixin
MixinBuilder
Parameter
ParameterBuilder
Reference
A reference to symbol, such as a class, or top-level method or field.
ResolvedAnnotation<T>
Special type of expression to store an annotation object during runtime
ResolvedValue<T>
Special type of code to hold a resolved value during runtime
ScopedCode
Represents a code block that may require scoping.
Spec
StaticCode
Represents a simple, literal code block to be inserted as-is.
SuperAnnotation<T extends Spec>
ToCodeExpression
TypeReference
TypeReferenceBuilder

Extensions

Cascade
ConstructorParameters
DefaultValue
Extension to quickly access the resolved default value of a parameter
HasResolvedAnnotations
Extension to quickly access all resolved annotations of a spec element
InvokeConstructor
ToMap

Constants

literalFalse → const Expression
Represents the literal value false.
LiteralExpression._('false')
literalNull → const Expression
Represents the literal value null.
LiteralExpression._('null')
literalTrue → const Expression
Represents the literal value true.
LiteralExpression._('true')

Functions

declareConst(String variableName, {Reference? type}) Expression
Declare a const variable named variableName.
declareFinal(String variableName, {Reference? type, bool late = false}) Expression
Declare a final variable named variableName.
declareVar(String variableName, {Reference? type, bool late = false}) Expression
Declare a variable named variableName.
equalsDart(String source, [DartEmitter? emitter]) Matcher
Returns a matcher for Spec objects that emit code matching source.
lazyCode(Code generate()) Code
Returns a generic Code that is lazily generated when visited.
lazySpec(Spec generate()) Spec
Returns a generic Spec that is lazily generated when visited.
literal(Object? literal, {Expression onError(Object)?}) Expression
Converts a runtime Dart literal value into an Expression.
literalBool(bool value) Expression
Create a literal expression from a boolean value.
literalConstList(List<Object?> values, [Reference? type]) LiteralListExpression
Creates a literal const list expression from values.
literalConstMap(Map<Object?, Object?> values, [Reference? keyType, Reference? valueType]) → LiteralMapExpression
Create a literal const map expression from values.
literalConstSet(Set<Object?> values, [Reference? type]) → LiteralSetExpression
Creates a literal const set expression from values.
literalList(Iterable<Object?> values, [Reference? type]) LiteralListExpression
Creates a literal list expression from values.
literalMap(Map<Object?, Object?> values, [Reference? keyType, Reference? valueType]) → LiteralMapExpression
Create a literal map expression from values.
literalNum(num value) Expression
Create a literal expression from a number value.
literalSet(Iterable<Object?> values, [Reference? type]) → LiteralSetExpression
Creates a literal set expression from values.
literalString(String value, {bool raw = false}) Expression
Create a literal expression from a string value.
refer(String symbol, [String? url]) Reference
Short-hand for Reference(symbol, url).

Enums

DirectiveType
DiscoveryMode
FieldModifier
InvokeExpressionType
MethodModifier
MethodType

Typedefs

CodeGenHook = void Function(LibraryBuilder output)