Here we will use ScaffoldMessenger, showSnackBar and snackBar together to show a message on button press from the bottom. Flutter ScaffoldMassenger is works for like showing pop up message. ScaffoldMassenger shows, hide and remove snackBar. The MaterialApp widget provides a root ScaffoldMessenger. If you show a SnackBar using the root ScaffoldMessenger, it becomes possible for all descendant Scaffolds to receive the SnackBar. However,…
Category: Flutter widgets
Flutter Not Found Animated Page | TweenAnimationBuilder | Text Animation
Let’s how do we use TweenAnimationBuilder to create not found page with animation. This is actually a text animation. We will do animation to make font bigger. The properties like curve, tween and duration plays an important role about the animation. The property tween value begin and end tell you where to start from and…
Flutter Custom Image with FadeInImage
It’s easy to customize image and related properties in flutter using FadeInImage.assetNetwork. We created a class called CustomImage and we pass parameters to it. Network image path could be sent as string to this CustomImage class and pass down to FadeInImage.assetNetwork Here Image.placeholder is the default image path. You can mention any image from assets…
Flutter Custom Loader
Here we will see how to create a custom loader in flutter. It’s easy to create one. We just create a stateless class and inside this we may use CircularProgressIndicator. CircularProgressIndicator is inside a Container(). So, we would be able to style as we want. The radius could be anything based on your needs. The…
Flutter Table | TableRow With for Loop
Here we will see how to use Table widget to read and show items from List and Map. First we will be using Table widget and we will set title to it. Then Table widget would take list of children. Inside the children we will use TableRow to show elements from the List. We will…
Flutter AlwaysStoppedAnimation
Flutter AlwaysStoppedAnimation() is great for animation which is used inside CircularProgressIndicator(). Without AlwaysStoppedAnimation(), CircularProgressIndicator runs very fast and we fast moving circle. We may use this to animate color. We can do color animation with this. Based on different condition we show different animation color inside AlwaysStoppedAnimation() widget. In our case, we have used BLoC…
Flutter TextSelection.collapsed() for Cursor
If you want to set the cursor position at the end of the text value or text field, then TextSelection.collapsed() is useful. It works together with TextEditingController(). Here offset plays an important rule where the cursor is placed. With current offset, the cursor would be placed right after each letter as you type. You may…
How to create a list of widgets in flutter
Let’s learn how to generate a list of widgets in flutter. To create a list of widgets in Flutter we can use List.generate() function. It looks like below So you see that it takes length, it means number of objects you wanna create. Then it takes a function, that function should be responsible for generating…
Flutter ExpansionPanelList.radio and ExpansionPanelRadio()
Flutter ExpansionPanelList.radio widget is excellent for showing and hiding panel and it’s description. With ExpansionPanelList.radio, we can make sure if you tap on a new panel, the older one close automatically. ExpansionPanelList.radio internally could use ExpansionPanelRadio() widget to show more items. ExpansionPanelList.radio() could be suitable for complex JSON or Map data structure.
Flutter Go_Route | Navigator 2.0
Flutter Go_Router for new ways of navigation in your app. Go Router is little bit like Getx Router. It takes a list of routes and at the same time you can mention the screen you want to navigate to. To be able to use go_router we need to use MaterialApp.router instead of MaterialApp in our…