Day 2 — What is StatelessWidget and an example of how it works

Gürkan Fikret GÜNAK
2 min readOct 19, 2020

--

Hello,💙

We continue where we left off. Today we will examine the StatelessWidget structure with you. I am aware that many read StatelfulWidget and StatelessWidget made mistakes by falling into a dilemma about the concept.

What is StatelessWidget?

It helps the structures inside to continue their construction efficiently without any change. It will also help about the permanence and continuity of the application performance. Why there may be too much in the Flutter application developer kit, they are divided into two in their content and dynamically. If we want the values ​​in it to be fixed while designing an interface, it is best to use the StatelessWidget. This will help us develop our application,

Let’s look at the source codes in more detail,

It has an inclusive color when we meet. This color will not change the code conversion within the application in any way. Naturally it makes sense to use the StatelessWidget tool here,

From another point of view, let’s examine the code below to better understand vehicle construction.

We define 2 parameters, one of them will be the color and the other will be the vehicle to work. The reason I do this is to realize that the tool we have built is not written over and over again, but rather by writing it as a single blog, providing us with practical in continuous use.

In this way, we will now define a practical way for more than one use. StatelessWidget is perfect for us when you want to use our fixed values in our interfaces as we explained at the beginning.

Summary
It is useful to say that it is a very good build for structures with static designs. Especially when creating content such as notification information and guide information on some pages, the most ideal structures can be tried.

#dart #flutter #google

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response