Issue I want to ignore all files ending with .g.dart, .inject.dart, .inject.summary in bin/ lib/ and test/ What is the syntax to ignore files dartanalyzer? I tried adding this section to my analysis_options.yaml file: analyzer: exclude: – lib/**.g.dart to my
Continue readingTag: dart-analyzer
Find function/method body explicit dependency types using Dart analyzer package
Issue I would like to understand how can I analyze methods / functions body to find types that are explicitly referenced from it. I have success analyzing method declaration (return type, parameter types, etc..), however I have no idea how
Continue readingdart enforce subtype in generic type (disallow base type) VS switch(Foo<T>)
Issue Given such classes sealed class Base { /* … */ } class X extends Base { /* … */ } class Y extends Base { /* … */ } class Foo<T extends Base> { final T t; const Foo({required
Continue readingHow to get the start and end number of an Element?
Issue I need to know the line number and column of start and end of an Element from the Analyzer package. For example: // Some class class Foo { String bar = ”; } The Foo class starts at line
Continue readingHow to get the start and end number of an ElementAnnotation?
Issue The ElementAnnotation from the analyzer package is really not an element so I can’t use ParsedLibraryResult.getElementDeclaration on it. How can I know the offset and end of an ElementAnnotation? Solution I had to get the node from the ClassElement
Continue readingDart analyzer not catching incompatible types when using null-coalescing operator
Issue I have the following code in a Flutter app that is currently running in unsound null safety mode (i.e. having both null-safe files and non-null-safe files). int i = null; String s = ”; double d = i ??
Continue readingIn Android Studio For Mac context Actions are not being displayed
Issue I have tried to enable the context actions in android studio but am not able to find any suggestions. when I press option + enter Checked in settings > intentions > Dart analysis still no use Checked in settings
Continue readingIn Dart, how do I get from the AST to Elements?
Issue In Dart, how do I get from the AST to Elements? I generate the AST like this: var ast = parseFile(path: "/home/user/myFile.dart", featureSet: FeatureSet.latestLanguageVersion()); I can access the declaration nodes, but I would like get to the Elements (e.g.
Continue readingSymbol with private identifier argument
Issue I want to create a symbol equal to that of a private MethodMirror’s simplename. However, Symbol’s documentation states the argument of new Symbol must be a valid public identifier. If I try and create a const Symbol(‘_privateIdentifier’) dart editor
Continue readingdartanalyzer doesn't give a warning for missing implementation from interface
Issue Currently I’m experimenting and learning the Dart language. I’m creating an abstract class with two abstract methods called IAnimal like this: abstract class IAnimal { String Walk(int distance); String Eat(String food); } Next I create a Dog class that
Continue reading