Flutter widgets 09 | FlutterLogo
In this tutorial, I will tell you how to use the FlutterLogo in the flutter.
Before start
The is a small widget, just show a flutter logo. But It is very interesting. Before telling its detail, let’s create an empty page to contain our tutorial code.
It shows nothing, but with a title as follows.
Simple Use
If you want to use the FlutterLogo, just add it as follows.
It will show like this, it shows just a logo of the flutter.
Constructor
As common as we do before, I will let you know the constructor of the FlutterLogo
.
We have learned the size parameter, this parameter controls the size of the FlutterLogo
. So Let's look at the other parameter.
colors
As the name we have seen, it is about the color, but you should know the parameter is aMaterialColor
. So let's use it.
style
When we look at its definition, you can see this as below.
The FlutterLogoStyle
has three types, the markOnly
only show the logo, the horizontal
show logo, and label in the horizontal direction, the stacked
show both but vertical direction. Let's look at the codes.
It will show like this.
duration & curve
If the properties of the FlutterLogo
have changed, such as color, style, and size, then there will be an animation occur. So the duration
parameter controls the time of the animation. The curve
controls the type of animation. Let's see an example.
Then it will show as follows and If you click the button, it will change the size of the logo, so you can see the animation with our setting.
Conclusion
The FlutterLogo
is a simple widget, it is easy to use, we mainly use its size, colors, style, and animation. But you should code it, then you will learn more detail about the widgets.
Thanks for your reading.
The End.
The whole code in Github: https://github.com/FlutterOpen/ebook