_common
library
Classes
AdjacentStrings
Two or more string literals that are implicitly concatenated because of
being adjacent (separated only by whitespace).
Annotatable
An element or fragment that can have either annotations (metadata), a
documentation comment, or both associated with it.
AnnotatedNode
An AST node that can be annotated with either a documentation comment, a
list of annotations (metadata), or both.
Annotation
An annotation that can be associated with a declaration.
ArgumentList
A list of arguments in the invocation of an executable element (that is, a
function, method, or constructor).
AsExpression
An as expression.
AssertInitializer
An assert in the initializer list of a constructor.
Assertion
An assertion, either in a block or in the initializer list of a constructor.
AssertStatement
An assert statement.
AssignedVariablePattern
A variable pattern in PatternAssignment .
AssignmentExpression
An assignment expression.
Assist
A base class for assists.
AstNode
A node in the AST structure for a Dart program.
AstVisitor <R >
An object that can be used to visit an AST structure.
AwaitAllFuturesRule
AwaitExpression
An await expression.
BinaryExpression
A binary (infix) expression.
BindPatternVariableElement
A pattern variable that is explicitly declared.
BindPatternVariableFragment
The portion of a BindPatternVariableElement contributed by a single
declaration.
Block
A sequence of statements.
BlockClassBody
The class body with members.
BlockFunctionBody
A function body that consists of a block of statements.
BooleanLiteral
A boolean literal expression.
BreakStatement
A break statement.
CascadeExpression
A sequence of cascaded expressions: expressions that share a common target.
CaseClause
The case clause that can optionally appear in an if statement.
CastPattern
A cast pattern.
CatchClause
A catch clause within a try statement.
CatchClauseParameter
An 'exception' or 'stackTrace' parameter in CatchClause .
ChangeBuilder
A class for modifying
ChangeReporter
A class used for requesting a ChangeBuilder .
ClassBody
The body of a class declaration.
ClassDeclaration
The declaration of a class.
ClassElement
A class.
ClassFragment
The portion of a ClassElement contributed by a single declaration.
ClassMember
A node that declares a name within the scope of a class, enum, extension,
extension type, or mixin declaration.
ClassNamePart
The name of a class, enum, or extension type declaration.
ClassTypeAlias
A class type alias.
CollectionElement
Combinator
A combinator associated with an import or export directive.
A comment within the source code.
An interface for an Expression which can make up a CommentReference .
A reference to a Dart element that is found within a documentation comment.
CompilationUnit
A compilation unit.
CompilationUnitMember
A node that declares one or more names within the scope of a compilation
unit.
CompoundAssignmentExpression
A potentially compound assignment.
ConditionalExpression
A conditional expression.
Configuration
A configuration in either an import or export directive.
ConstantPattern
A constant expression being used as a pattern.
ConstructorDeclaration
A constructor declaration.
ConstructorElement
An element representing a constructor defined by a class, enum, or extension
type.
ConstructorFieldInitializer
The initialization of a field within a constructor's initialization list.
ConstructorFragment
The portion of a ConstructorElement contributed by a single declaration.
ConstructorInitializer
A node that can occur in the initializer list of a constructor declaration.
ConstructorName
The name of a constructor.
ConstructorReference
An expression representing a reference to a constructor.
ConstructorReferenceNode
An AST node that makes reference to a constructor.
ConstructorSelector
The name of a constructor being invoked.
ContinueStatement
A continue statement.
CustomLintConfigs
Configurations representing the custom_lint metadata in the project's analysis_options.yaml.
CustomLintContext
An object for state shared between multiple LintRule /Assist /Fix ...
CustomLintResolver
A class used to interact with files and possibly emit lints of out it.
DartAssist
A base class for creating assists inside Dart files.
DartFix
A base class for defining quick-fixes inside Dart files.
DartLintRule
A base class for emitting warnings/errors/infos inside Dart files.
DartPattern
A pattern.
DartType
The type associated with elements in the element model.
Declaration
A node that represents the declaration of one or more names.
DeclaredIdentifier
The declaration of a single identifier.
DeclaredVariablePattern
A variable pattern that declares a variable.
DefaultFormalParameter
A formal parameter with a default value.
Directive
A node that represents a directive.
DirectiveUri
Meaning of a URI referenced in a directive.
DirectiveUriWithLibrary
DirectiveUriWithSource that references a LibraryElement .
DirectiveUriWithRelativeUri
DirectiveUriWithRelativeUriString that can be parsed into a relative URI.
DirectiveUriWithRelativeUriString
DirectiveUri for which we can get its relative URI string.
DirectiveUriWithSource
DirectiveUriWithRelativeUri that resolves to a Source.
DirectiveUriWithUnit
DirectiveUriWithSource that references a LibraryFragment .
DoStatement
A do statement.
DotShorthandConstructorInvocation
A node that represents a dot shorthand constructor invocation.
DotShorthandInvocation
A node that represents a dot shorthand static method or constructor
invocation.
DotShorthandPropertyAccess
A node that represents a dot shorthand property access of a field or a
static getter.
DottedName
A dotted name, used in a configuration within an import or export directive.
DoubleLiteral
A floating point literal expression.
DynamicType
The type dynamic is a type which is a supertype of all other types, just
like Object, with the difference that the static analysis assumes that
every member access has a corresponding member with a signature that
admits the given access.
Element
The base class for all of the elements in the element model.
ElementAnnotation
A single annotation associated with an element.
ElementDirective
A directive within a library fragment.
ElementKind
The kind of elements in the element model.
ElementVisitor2 <R >
An object that can be used to visit an element structure.
EmptyClassBody
The empty class body.
EmptyFunctionBody
An empty function body.
EmptyStatement
An empty statement.
EnumBody
The enum declaration body, with constants and members.
EnumConstantArguments
The arguments part of an enum constant.
EnumConstantDeclaration
The declaration of an enum constant.
EnumDeclaration
The declaration of an enumeration.
EnumElement
An element that represents an enum.
EnumFragment
The portion of an EnumElement contributed by a single declaration.
ExecutableElement
An element representing an executable object, including functions, methods,
constructors, getters, and setters.
ExecutableFragment
The portion of an ExecutableElement contributed by a single declaration.
ExportDirective
An export directive.
Expression
A node that represents an expression.
ExpressionFunctionBody
A function body consisting of a single expression.
ExpressionStatement
An expression used as a statement.
ExtendsClause
The "extends" clause in a class declaration.
ExtensionDeclaration
The declaration of an extension of a type.
ExtensionElement
An extension.
ExtensionFragment
The portion of an ExtensionElement contributed by a single
declaration.
ExtensionOnClause
The on clause in an extension declaration.
ExtensionOverride
An override to force resolution to choose a member from a specific
extension.
ExtensionTypeDeclaration
The declaration of an extension type.
ExtensionTypeElement
An extension type.
ExtensionTypeFragment
The portion of an ExtensionTypeElement contributed by a single
declaration.
FieldDeclaration
The declaration of one or more fields of the same type.
FieldElement
A field defined within a class, enum, extension, or mixin.
FieldFormalParameter
A field formal parameter.
FieldFormalParameterElement
A field formal parameter defined within a constructor element.
FieldFormalParameterFragment
The portion of a FieldFormalParameterElement contributed by a single
declaration.
FieldFragment
The portion of a FieldElement contributed by a single declaration.
Fix
A base class for plugins to define emit warnings/errors/infos.
ForEachParts
The parts of a for-each loop that control the iteration.
ForEachPartsWithDeclaration
The parts of a for-each loop that control the iteration when the loop
variable is declared as part of the for loop.
ForEachPartsWithIdentifier
The parts of a for-each loop that control the iteration when the loop
variable is declared outside of the for loop.
ForEachPartsWithPattern
A for-loop part with a pattern.
ForElement
The basic structure of a for element.
ForLoop <Body extends AstNode >
A for or for-each statement or collection element.
ForLoopParts
The parts of a for or for-each loop that control the iteration.
FormalParameter
A node representing a parameter to a function.
FormalParameterElement
A formal parameter defined by an executable element.
FormalParameterFragment
The portion of a FormalParameterElement contributed by a single
declaration.
FormalParameterList
The formal parameter list of a method declaration, function declaration, or
function type alias.
ForParts
The parts of a for loop that control the iteration.
ForPartsWithDeclarations
The parts of a for loop that control the iteration when there are one or
more variable declarations as part of the for loop.
ForPartsWithExpression
The parts of a for loop that control the iteration when there are no
variable declarations as part of the for loop.
ForPartsWithPattern
The parts of a for loop that control the iteration when there's a pattern
declaration as part of the for loop.
ForStatement
A for or for-each statement.
Fragment
A fragment that wholly or partially defines an element.
FunctionBody
A node representing the body of a function or method.
FunctionDeclaration
A function declaration.
FunctionDeclarationStatement
A FunctionDeclaration used as a statement.
FunctionExpression
A function expression.
FunctionExpressionInvocation
The invocation of a function resulting from evaluating an expression.
FunctionReference
An expression representing a reference to a function, possibly with type
arguments applied to it.
FunctionType
The type of a function, method, constructor, getter, or setter. Function
types come in three variations:
FunctionTypeAlias
A function type alias.
FunctionTypedElement
An element that has a FunctionType as its type .
FunctionTypedFormalParameter
A function-typed formal parameter.
FunctionTypedFragment
The portion of a FunctionTypedElement contributed by a single declaration.
GenericFunctionType
An anonymous function type.
GenericFunctionTypeElement
The pseudo-declaration that defines a generic function type.
GenericFunctionTypeFragment
The portion of a GenericFunctionTypeElement coming from a single
declaration.
GenericTypeAlias
A generic type alias.
GetterElement
A getter.
GetterFragment
The portion of a GetterElement contributed by a single declaration.
GuardedPattern
The pattern with an optional WhenClause .
HideCombinator
A combinator that restricts the names being imported to those that aren't
in a given list.
HideElementCombinator
A combinator that causes some of the names in a namespace to be hidden when
being imported.
Identifier
A node that represents an identifier.
IfElement
The basic structure of an if element.
IfStatement
An if statement.
ImplementsClause
The "implements" clause in an class declaration.
ImplicitCallReference
An expression representing an implicit 'call' method reference.
ImportDirective
An import directive.
ImportPrefixReference
Reference to an import prefix name.
IndexExpression
An index expression.
InstanceCreationExpression
An instance creation expression.
InstanceElement
An element whose instance members can refer to this.
InstanceFragment
The portion of an InstanceElement contributed by a single declaration.
InstantiatedTypeAliasElement
Information about an instantiated TypeAliasElement and the type
arguments with which it is instantiated.
IntegerLiteral
An integer literal expression.
InterfaceElement
An element that defines an InterfaceType .
InterfaceFragment
The portion of an InterfaceElement contributed by a single declaration.
InterfaceType
The type introduced by either a class or an interface, or a reference to
such a type.
InterpolationElement
A node within a StringInterpolation .
InterpolationExpression
An expression embedded in a string interpolation.
InterpolationString
A non-empty substring of an interpolated string.
InvalidType
The type arising from code with errors, such as invalid type annotations,
wrong number of type arguments, invocation of undefined methods, etc.
InvocationExpression
The invocation of a function or method.
IsExpression
An is expression.
JoinPatternVariableElement
A pattern variable that is a join of other pattern variables, created
for a logical-or patterns, or shared case bodies in switch statements.
JoinPatternVariableFragment
The portion of a JoinPatternVariableElement contributed by a single
declaration.
Label
A label on either a LabeledStatement or a NamedExpression .
LabeledStatement
A statement that has a label associated with them.
LabelElement
A label associated with a statement.
LabelFragment
The portion of a LabelElement contributed by a single declaration.
LibraryDirective
A library directive.
LibraryElement
A library.
LibraryExport
An export directive within a library fragment.
LibraryFragment
The portion of a LibraryElement coming from a single compilation unit.
LibraryIdentifier
The identifier for a library.
LibraryImport
An import directive within a library fragment.
LibraryLanguageVersion
LintCode
A class representing an ErrorCode for LintRule s.
LintOptions
Option information for a specific LintRule .
LintRule
A base class for plugins to define emit warnings/errors/infos.
LintRuleNodeRegistry
ListLiteral
A list literal.
ListPattern
A list pattern.
ListPatternElement
An element of a list pattern.
Literal
A node that represents a literal expression.
LocalElement
An element that can be (but is not required to be) defined within a method
or function (an ExecutableFragment ).
LocalFragment
The portion of an LocalElement contributed by a single declaration.
LocalFunctionElement
A local function.
LocalFunctionFragment
The portion of a LocalFunctionElement contributed by a single
declaration.
LocalVariableElement
A local variable.
LocalVariableFragment
The portion of a LocalVariableElement contributed by a single
declaration.
LogicalAndPattern
A logical-and pattern.
LogicalOrPattern
A logical-or pattern.
MapLiteralEntry
A single key/value pair in a map literal.
MapPattern
A map pattern.
MapPatternElement
An element of a map pattern.
MapPatternEntry
An entry in a map pattern.
Metadata
The metadata (annotations) associated with an element or fragment.
MethodDeclaration
A method declaration.
MethodElement
A method.
MethodFragment
The portion of a MethodElement contributed by a single declaration.
MethodInvocation
The invocation of either a function or a method.
MethodReferenceExpression
An expression that implicitly makes reference to a method.
MixinDeclaration
The declaration of a mixin.
MixinElement
An element that represents a mixin.
MixinFragment
The portion of a PrefixElement contributed by a single declaration.
MixinOnClause
The "on" clause in a mixin declaration.
MultiplyDefinedElement
A pseudo-element that represents multiple elements defined within a single
scope that have the same name. This situation is not allowed by the
language, so objects implementing this interface always represent an error.
As a result, most of the normal operations on elements do not make sense
and will return useless results.
MultiplyDefinedFragment
The fragment for a MultiplyDefinedElement .
MustBeAnonymousRule
MustBeStronglyRefRule
MustHandleReturnRule
Fires when a function or method annotated @mustHandleReturn /
@mustHandleReturnOrError has its return value discarded.
MustUseOutcomeRule
MustUseUnsafeWrapperRule
Name
A public name, or a private name qualified by a library URI.
NamedCompilationUnitMember
A node that declares a single name within the scope of a compilation unit.
NamedExpression
An expression that has a name associated with it.
NamedType
A named type, which can optionally include type arguments.
NamespaceCombinator
An object that controls how namespaces are combined.
NamespaceDirective
A node that represents a directive that impacts the namespace of a library.
NameWithTypeParameters
The type name with optional type parameters.
NativeClause
The "native" clause in an class declaration.
NativeFunctionBody
A function body that consists of a native keyword followed by a string
literal.
NeverType
The type Never represents the uninhabited bottom type.
NodeList <E extends AstNode >
A list of AST nodes that have a common parent.
NoFutureOutcomeTypeRule
NoFuturesRule
NormalFormalParameter
A formal parameter that is required (isn't optional).
NullAssertPattern
A null-assert pattern.
NullAwareElement
A null-aware element in a list or set literal.
NullCheckPattern
A null-check pattern.
NullLiteral
A null literal expression.
NullShortableExpression
Abstract interface for expressions that may participate in null-shorting.
ObjectPattern
An object pattern.
ParameterizedType
A type that can track substituted type parameters, either for itself after
instantiation, or from a surrounding context.
ParenthesizedExpression
A parenthesized expression.
ParenthesizedPattern
A parenthesized pattern.
PartDirective
A part directive.
PartInclude
A 'part' directive within a library fragment.
PartOfDirective
A part-of directive.
PatternAssignment
A pattern assignment.
PatternField
A field in an object or record pattern.
PatternFieldName
A field name in an object or record pattern field.
PatternVariableDeclaration
A pattern variable declaration.
PatternVariableDeclarationStatement
A pattern variable declaration statement.
PatternVariableElement
A pattern variable.
PatternVariableFragment
The portion of a PatternVariableElement contributed by a single
declaration.
PluginBase
A base class for custom analyzer plugins
PostfixExpression
A postfix unary expression.
PrefixedIdentifier
An identifier that is prefixed or an access to an object property where the
target of the property access is a simple identifier.
PrefixElement
A prefix used to import one or more libraries into another library.
PrefixExpression
A prefix unary expression.
PrefixFragment
The portion of a PrefixElement contributed by a single declaration.
PrimaryConstructorDeclaration
The declaration of a primary constructor.
PrimaryConstructorName
The name of a primary constructor.
PropertyAccess
The access of a property of an object.
PropertyAccessorElement
A getter or a setter.
PropertyAccessorFragment
The portion of a GetterElement contributed by a single declaration.
PropertyInducingElement
A variable that has an associated getter and possibly a setter. Note that
explicitly defined variables implicitly define a synthetic getter and that
non-final explicitly defined variables implicitly define a synthetic
setter. Symmetrically, synthetic fields are implicitly created for
explicitly defined getters and setters. The following rules apply:
PropertyInducingFragment
The portion of a PropertyInducingElement contributed by a single
declaration.
RecordLiteral
A record literal.
RecordPattern
A record pattern.
RecordType
The type of a record literal or a record type annotation.
RecordTypeAnnotation
A record type.
RecordTypeAnnotationField
A field in a RecordTypeAnnotation .
RecordTypeAnnotationNamedField
A named field in a RecordTypeAnnotation .
RecordTypeAnnotationNamedFields
The portion of a RecordTypeAnnotation with named fields.
RecordTypeAnnotationPositionalField
A positional field in a RecordTypeAnnotation .
RecordTypeField
A field in a RecordType .
RecordTypeNamedField
A named field in a RecordType .
RecordTypePositionalField
A positional field in a RecordType .
RecursiveAstVisitor <R >
An AST visitor that will recursively visit all of the nodes in an AST
structure. For example, using an instance of this class to visit a Block
will also cause all of the statements in the block to be visited.
RedirectingConstructorInvocation
The invocation of a constructor in the same class from within a
constructor's initialization list.
RelationalPattern
A relational pattern.
RepresentationConstructorName
The name of the primary constructor of an extension type.
RepresentationDeclaration
The declaration of an extension type representation.
RestPatternElement
A rest pattern element.
RethrowExpression
A rethrow expression.
ReturnStatement
A return statement.
ScriptTag
A script tag that can optionally occur at the beginning of a compilation
unit.
SetOrMapLiteral
A set or map literal.
SetterElement
A setter.
SetterFragment
The portion of a SetterElement contributed by a single declaration.
ShowCombinator
A combinator that restricts the names being imported to those in a given
list.
ShowElementCombinator
A combinator that cause some of the names in a namespace to be visible (and
the rest hidden) when being imported.
SimpleFormalParameter
A simple formal parameter.
SimpleIdentifier
A simple identifier.
SimpleStringLiteral
A string literal expression that doesn't contain any interpolations.
SingleStringLiteral
A single string literal expression.
SpreadElement
A spread element.
Statement
A node that represents a statement.
StringInterpolation
A string interpolation literal.
StringLiteral
A string literal expression.
SuperConstructorInvocation
The invocation of a superclass' constructor from within a constructor's
initialization list.
SuperExpression
A super expression.
SuperFormalParameter
A super-initializer formal parameter.
SuperFormalParameterElement
A super formal parameter.
SuperFormalParameterFragment
The portion of a SuperFormalParameterElement contributed by a single
declaration.
SwitchCase
A case in a switch statement.
SwitchDefault
The default case in a switch statement.
SwitchExpression
A switch expression.
SwitchExpressionCase
A case in a switch expression.
SwitchMember
An element within a switch statement.
SwitchPatternCase
A pattern-based case in a switch statement.
SwitchStatement
A switch statement.
SymbolLiteral
A symbol literal expression.
ThisExpression
A this expression.
ThrowExpression
A throw expression.
TopLevelFunctionElement
A top-level function.
TopLevelFunctionFragment
The portion of a TopLevelFunctionElement contributed by a single
declaration.
TopLevelVariableDeclaration
The declaration of one or more top-level variables of the same type.
TopLevelVariableElement
A top-level variable.
TopLevelVariableFragment
The portion of a TopLevelVariableElement contributed by a single
declaration.
TryStatement
A try statement.
TypeAlias
The declaration of a type alias.
TypeAliasElement
A type alias (typedef).
TypeAliasFragment
The portion of a TypeAliasElement contributed by a single declaration.
TypeAnnotation
A type annotation.
TypeArgumentList
A list of type arguments.
TypeChecker
An abstraction around doing static type checking at compile/build time.
TypeDefiningElement
An element that defines a type.
TypeDefiningFragment
The portion of a TypeDefiningElement contributed by a single declaration.
TypedLiteral
A literal that has a type associated with it.
TypeLiteral
An expression representing a type, such as the expression int in
var x = int;.
TypeParameter
A type parameter.
TypeParameterElement
A type parameter.
TypeParameterFragment
The portion of a TypeParameterElement contributed by a single
declaration.
TypeParameterizedElement
An element that has type parameters, such as a class, typedef, or method.
TypeParameterizedFragment
The portion of a TypeParameterizedElement contributed by a single
declaration.
TypeParameterList
Type parameters within a declaration.
TypeParameterType
The type introduced by a type parameter.
UriBasedDirective
A directive that references a URI.
VariableDeclaration
An identifier that has an initial value associated with it.
VariableDeclarationList
The declaration of one or more variables of the same type.
VariableDeclarationStatement
A list of variables that are being declared in a context where a statement
is required.
VariableElement
A variable.
VariableFragment
The portion of a VariableElement contributed by a single declaration.
VariablePattern
The shared interface of AssignedVariablePattern and
DeclaredVariablePattern .
VoidType
The special type void is used to indicate that the value of an
expression is meaningless, and intended to be discarded.
WhenClause
A guard in a pattern-based case in a switch statement, switch
expression, if statement, or if element.
WhileStatement
A while statement.
WildcardPattern
A wildcard pattern.
WithClause
The with clause in a class declaration.
YieldStatement
A yield statement.
Functions
createPlugin ()
→ PluginBase
encodePrioritizedSourceChanges (Iterable <PrioritizedSourceChange > changes , {JsonEncoder ? encoder , Map <String , String > ? sources , String ? relativePath })
→ String
Encodes a list of PrioritizedSourceChange into a string.
findProjectDirectory (Directory directory , {Directory ? original })
→ Directory
Finds the project directory associated with an analysis context root
isDirectlyAnnotatedByText (AnnotatedNode node , String shortName , String longName )
→ bool
Returns true if node is annotated with an annotation whose identifier
exactly matches shortName (the const instance) or longName (the class).
isFutureOrFutureOr (DartType ? type )
→ bool
matcherNormalizedPrioritizedSourceChangeSnapshot (String filePath , {JsonEncoder ? encoder , Map <String , String > ? sources , String ? relativePath })
→ Matcher
Expects that a `List<PrioritizedSourceChange>` matches with a serialized snapshots.
parsePackageConfig (Directory directory )
→ Future <PackageConfig >
Parse the package config of the given directory.
parsePubspec (Directory directory )
→ Future <Pubspec >
Parse the pubspec of the given directory.
parsePubspecOverrides (Directory directory )
→ Future <Map <String , Dependency > >
Parse the pubspec_overrides.yaml of the given directory.
parsePubspecSync (Directory directory )
→ Pubspec
Parse the pubspec of the given directory.
tryFindProjectDirectory (Directory directory , {Directory ? original })
→ Directory ?
Finds the project directory associated with an analysis context root, or null if it is not found
tryParsePackageConfig (Directory directory )
→ Future <PackageConfig? >
Try parsing the package config of the given directory.
tryParsePubspec (Directory directory )
→ Future <Pubspec? >
Try parsing the pubspec of the given directory.
tryParsePubspecOverrides (Directory directory )
→ Future <Map <String , Dependency > ? >
Try parsing the pubspec_overrides.yaml of the given directory.
tryParsePubspecSync (Directory directory )
→ Pubspec?
Try parsing the pubspec of the given directory.
df_safer_dart_lints 0.5.1