6

DartType from analyzer package have some properties: isDartCoreNum, isDartCoreInt, isDartCoreDouble

How to do check DartType is custom type (DartType represents Employee or Bus NOT int or double)?

This is necessary for I need to discover FieldElement type during analyze of code. How to do it?

Boris Salimov
  • 663
  • 2
  • 7
  • 18

1 Answers1

0

You can use TypeChecker from source_gen.
ie:

TypeChecker.fromRuntime(Employee).isAssignableFromType(myType);
Jonathan
  • 4,724
  • 7
  • 45
  • 65