flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.05k stars 27.2k forks source link

Documentation: Include import statement in every class definition document #81317

Open ghost opened 3 years ago

ghost commented 3 years ago

Part of the documentation in most of the language websites that I have seen in the past have included an "import" (flutter term) statement to enable the user to include the class in their application.

This seems to be an important piece of information, just as much as methods and properties.

Now I have a new class in my application and I do not know how to import it into my application. I am sure there is a way to find out where it is located, but a simple one line statement in the class documentation would make it so much simpler.

darshankawar commented 3 years ago

@leemke Can you point us to the documentation example you are referring to ? Thanks.

ghost commented 3 years ago

All/any of the class definitions found under the following links https://api.flutter.dev/flutter/animation/AlwaysStoppedAnimation-class.html https://api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html https://api.flutter.dev/flutter/widgets/StatefulWidget-class.html

I would conclude all flutter/widgets lack a statement of how to include their specification. Cupertino is the one I was wanting at the time. Don't assume that a person who is trying to use a class new to them, that they have never seen before, knows exactly how to include it in their application. The vast number of classes makes it impossible for a person to know the contents of each library or even the set of all possible libraries.

goderbauer commented 2 years ago

This would probably require support from dart docs: https://github.com/dart-lang/dartdoc/issues