Normally, flutter will not use Global Keys. When you create a stateful widget, two object get created: a widget, and it’s state. The idea is that the widget itself will be destroyed at the end of the build (or after it is painted on the screen). Once you initiate the build again (through setState() for…
Month: November 2022
Flutter Auto-resize TextFields
Here we will learn how to do auto-resize textfields. In general flutter textfields, the text goes up as you type in. But sometimes for better user experience, you don’t want the text to go up automatically. You want them to be visible. Being visible, you may edit the text any time. You should use maxLines…
How to update camera position flutter google map?
Here we will see how to update camera position using flutter google map. First make sure you use GoogleMap() widget and create a google map object in your widget tree. At the same time make sure that, you have created initial value for Camera Position. If you class is stateful class, make sure that you…
Flutter Google Map PlaceMark | Geocoding
Placemark is a class that contains information like place’s name, locality, postalCode, country and other properties. You should be using this once you get String address from google map api. You may pass your string address to Placemark() class. The above code should be put inside a controller and the snippet tells you how to use…
Flutter Stack Widget Center Items Alignment
If you have a lot of children inside stack widget, and you all of them to start from the center of the parent widget of stack widget, then you alignment property for it. Inside a parent widget below is our stack widget As you can see everything is messed up here. But we want everything…
Flutter Builder Widget
Flutter Builder widget is helpful and simple to use. There are two cases where you may use builder widget. Here we have an example that takes parent widget’s context and build the UI. Here you see for builder property we are passing a function with context and then returning a widget. This Builder widget helps…
Flutter Circular Progress Indicator Animation BLoC
Here we will carry on from the first part, where we learned how to make a timer app using BLoC pattern. Then in part two we learned how to make a linear progress indicator. In this part we will see how to make circular progress indicator. As usual we will use elapsed time to do…
Flutter Firebase Google Auth Repository
Learn how to create flutter firebase google auth repository. First we wanna have bunch of methods, that will help us to work with google firebase login and logout. Here we included singUp, singIn, singInWithGoogle and singOut method. We need to create a class called AuthRepository. First of all we get a FirebaseAuth.instance object. We will…
How to Stop a Timer in Flutter BLoC
It may sound tricky to stop a timer app in bloc. In fact it’s easy. First you have to understand why your BLoC started to run the timer app? It’s because you triggered an event. That event emitted a state, and because of that state we were able to start the timer. First we emitted…
Flutter Blink Text Widget
Let’s learn how to make a blink text widget in Flutter. To make a blink text we need a stateful class, Timer.periodic() and some strings. First, we created a _timer object using Timer.periodic() Timer.periodic() toggles a boolean named _show in every 500 milliseconds, based on the boolean we show or hide the text. The actual…