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



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

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. 

There's also a feature request to support the inlay hints natively in the Dart plugin. Please vote to get notified on progress:


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


Please sign in to leave a comment.