Сообщения

Сообщения за декабрь, 2021

SliverAppBar in Flutter

Изображение
       Flutter uses the well-known AppBar to create a toolbar, but when we need a dynamic toolbar that will show content on swipe, we use the excellent SliverAppBar widget.      Both Both widgets allow you to make your application a little prettier, which is no doubt very simple in Flutter.       I have seen many questions on StackOverflow and Facebook groups about how the AppBar and SliverAppBar can be changed in terms of behavior or design.      Let's look at two tasks.      Task 1      We want to create a non-screwed AppBar , but not in the usual way. We want to add a Drawer that the AppBar will respond to when opened. That's it: our own AppBar with the dimensions we need.      The problem is that, as we know, the AppBar has a default size, and we cannot change it. Looking at the source code, we see the AppBar parameter in Scaffold, we see that it accepts a PreferredSizeWidget widget, now we look at the source code of the AppBar and find out that this is only a StatefulWidg

Shimmer effect by Flutter

Изображение
      Hi, dear readers. Today, we will discuss another useful Widget in Flutter Animations, Shimmer Animation .     So, what is a purpose of using Shimmer Effect in our app? Answer is included in loading time of our application. Progress indicators and shimmer animations are methods to show users that loading in the process. Let's create our own Shimmer Animation Before to start coding, you need to know  properties of carousel slider: >   baseColor:  Base Color of the Shimmer that gets displayed on the Widget. This color is essential as the child widget will be of this color as it were. > highlightColor:  Highlight Color is the color that delivers the shimmer-like impact. This color continues to wave across the child widget and it makes the Shimmer impact. > child:  The Child holds whatever widget needs to create the ShimmerEffect . Could be a Text Widget or an intricate design and the ShimmerEffect is created with no issue. >   direction:  You can adjust the direction