How to get the type or custom type of a dart value?

Answered

 

Hello, may I ask you to get the type text of the dart expression value. I am making a type hint function here, but it has not been able to get it correctly. The boolean displayed here should be correct.

 

 

this is my code

3 comments
Comment actions Permalink
Official comment

Dart language support in IntelliJ IDEA is based on the Dart Analysis Server. It’s a tool from the Dart SDK, which works as a language server. So, all smartness in the Dart plugin comes from the server. Here you'll find the server API. The main class in the Dart plugin is DartAnalysisServerService.

You see the information about the variable type on hover.

This functionality is backed by the DartDocumentationProvider class and analysis.getHover call to the server. 

Comment actions Permalink

There's also a feature request to support the inlay hints natively in the Dart plugin. Please vote to get notified on progress: https://youtrack.jetbrains.com/issue/WEB-53819

0
Comment actions Permalink

Thanks for your thoughtful answer, it helped me a lot, now I have solved the problem

 
0

Please sign in to leave a comment.