Getting started with Flutter? Do NOT overlook API Documentation

Duncan Adjei
Flutter Community
Published in
5 min readJun 5, 2019

Often times newbies or old geeks spend most of their time contemplating the benefits of a stack over the other before they choose for their projects. This is the norm of the day, we all choose stack base on benefits, perhaps cross-platform, learning curve, single code base, code reusability, less boilerplate, continues integration and the likes. Did you consider clean API documentation?. There were episodes of migraine before jumping on Flutter and yet it was worth it because Flutter never disappoints.

The Flutter framework is loved by many developers, there are tons of projects and challenges on Github, YouTube channels and just mention them. The official flutter website flutter.dev gives you access to a lot of code examples including the code labs and the example projects. This makes it easy to find the solution to your bugs and any challenge you are likely to come across with Flutter. This whole ecosystem makes Flutter beautiful. But wait, no one is talking about encouraging people to always make reference to the documentation (if there is, perhaps I haven’t seen one yet) to resolve their bug or a weird error that came out of the box. Some answers might be easy to find when the API Documentations is consulted and this is why you are here.

Why API Documentations?

The documentation is the official guideline defined by the Google Flutter engineers on how a class, inheritance, properties, methods should function or can be used. A stronger understanding of every framework lies in the hands of a genuine understanding of the documentation.

The documentation is the entry point for using Flutter framework, of course, copying and pasting examples from code lab, StackOverflow is very helpful but for an in-depth understanding of how things work under the hook. Documentation should be where you sleep.

It is better to understand it from the context it is meant for.

By understanding what a particular widget is meant for, it encourages customization and tweaking around to build something that is appropriate for your use case.

Of course, coming across ambiguity and error which I do not really anticipate, however, if there is any, by creating an issue or pulling request can also make it all better or whichever way the support is needed to strengthen the flutter documentation.

To understand why you run yourself into some weird issues, bugs that takes you days to resolve.

This will help you explore lots of widgets which you might be hoping for but probably have not seen or read on because none is talking about it or you have never seen it in action.

Most of the engineers on the Flutter Team at Google, demonstrate this best practice by referring to the API documentation for a detailed understanding of a class or a widget. This can be found in some of the episodes on The boring flutter development show on Flutter youtube channel. Here

Where do I get API Documentations?

The API documentation can be found inside your computer locally as long as you have the SDK for Flutter, when you open a class reference in VS code, Android Studio or others, the beginning of each class has its specific documentation, the official page for the flutter API documentation reference is https://api.flutter.dev/ and of course Github because they are all Open Source https://github.com/flutter/flutter

Note: You can add this to your chrome search engines by reading my previous article published in the flutter community. Here !.

How do I understand API Documentation?

Below is a picture of the Container class API documentation reference in Flutter

API documentation page for Container

From the above picture, you can see a brief introduction of the Container and what it does. It also made mention of some properties of this widget. This should at least give you a fair idea on what the container widget does.

Note: Might be using widget and class interchangeably.

The API documentation of the Container Class

The blue documentation icon button takes you to the GitHub implementation page of this class. The class gives you a clear understanding of the properties of the widget, constructor, methods, behavior of the class and it varies from one widget to the other. Below is the page that contains the properties of a container. I will talk about the properties since it is the most often used of a widget, of course, you can explore the others.

In most cases, you will be dealing with the properties of the widgets, all the properties of the container widget have been stated and also describe what it does. This makes it all beautiful, you don't need to be a genius to understand. They are all in simple words and terminologies.

Those with […] at their ending has detailed documentation and by visiting, you will explore more about that property and its usage. The content in the documentation is beginner friendly. And that's a plus.

How do I use API Documentation?

The documentation often gives you an example of how widgets are used. The image below depicts an example code of the Container class from the GitHub.

By holding the CTRL key and clicking on the Class Container from your IDE should take you there.

From the picture, there is a short description of what this container is being used for. They made use of some properties like color, constraint, child, alignment transform of the Container class. These properties affect the widget base on their defined use case. This makes it all beautiful and easy to understand widgets.

Exploring more widgets from Documentation.

The API documentation reference gives you a detailed understanding of every widget. Constantly reading and making reference to the documentation will help you understand the Widgets and also helps you to explore other hidden widgets.

How do I contribute to the API Documentation?

Open source tells you all and flutter is. Everyone is welcome to contribute and also create issues, that’s a major way of making flutter a better framework for the future. You can find more information on the contribution processes on the wiki home page and also understanding the tree hygiene here.

Thank you for coming here, don’t forget to encourage other developers and engineers to give much attention to the documentation and also promote reading it. It will be worth it.

HAPPY CODING!!!

--

--

Duncan Adjei
Flutter Community

Problem Solving Not Syntax!…..🤩 Software Engineer by Day 🌗 Researcher at Night🤯Interest: 👉User Experience🥳 and Software Architecture Advocate⚙️📐📏