How to use flutter documentation

Raouf Rahiche
Flutter Community
Published in
4 min readDec 10, 2018

Some simple but powerful tips

After using Flutter for almost a year now the documentation is my second home.

Today I will share some very simple yet powerful tips and tricks to get the most out of Flutter’s documentation.

Documentation In Code

flutter code source example

YES, you have documentation offline negating the need to visit the website most of the time. That said, the docs site is more organized and contains more information and tools.

Just remember that Flutter is open source and the docs are the source itself. The docs website, docs.flutter.io actually uses the data generated from source code.

New to flutter? Coming from another platform?

So you want to start with Flutter but this is not your first time working with a mobile development platform. Flutter makes it easy for developers to use their prior experience as a starting point. On Flutter’s website, there are full getting started guides for Android, IOS, ReactNative, Xamrin.Forms and web.

What are the available option for this abstract class?

Let’s say you are trying to explore the framework or you are in the situation where a widget requires a specific type of data but when you look at the source, it’s an abstract class. This leaves you in a situation where you can’t instantiate the class but find/use a concrete implantation instead.

This can be done with the tools provided by the IDE(for example use find usages in IntelliJ idea ) but it will take time. Another approach would be to check Flutter’s website. If you search the abstract class, the result would include a section on all classes which implements the queried class.

For example, the Shape property in the class ShapeDecoration is a type of ShapeBorder. This class is abstract so searching on would list all the implementers of ShapeBorder.

Another useful example would be finding all available tween. Just search for the Tween class and you would be presented with various implementations of tween which you can use in your app.

But I am on Master?

If you are on master and need to find something that is specific to that branch, the Flutter team has got you back. There is a version of the Flutter docs website which generates it’s docs from the found code in master.

Some widgets they don’t have any sample code?

The Flutter docs are great but sometimes when you go a little bit deeper you will not find any sample code. That’s okay because you can find more in the flutter repo test files.

Let’s take an example like SliverList you will find a really good explanation in the docs but no example. If you go to the Flutter repo in GitHub and search for the widget

then try to find the file in the test directory

you will find more than just one example so enjoy it!

Go to source code directly from the docs

This is helpful when you are just reading the docs and you want to see how something is implemented you can’t do that directly. Luckily there is a chrome extension which adds just that created by Sergi And Replace.

I hope you enjoyed this short article. If you have something in mind or you have a tip on how to use the flutter docs feel free to share it in the comments below.

Don’t forget to follow Flutter Community and myself on Twitter for more articles.

--

--