Here we will learn how to use map inside map or created nested map in dart flutter. Map itself could be a little confusing for beginners in Dart. So map inside map is complex at first sight. But it’s actually easy. First take a look at a Map object. What’s the format or syntax of…
Month: October 2022
Flutter Getx Localization Translations String Format
If you use Getx to do localization, you need to use Translations class. Actually before we use the Translation class, we need to return loaded json in format. Loaded json has to return in the above format. Then we may pass it to Message(languages:languages) Let’s take a look at the Message class. The Messages class…
How to handle api response in Getx Flutter
Here we will learn how to handle api response in Getx for http request. In a nicely structured app project, handling api request is the most important since, it let’s you know the response object, error type, json object, status code like that. At the end it’s more about how you return json response from…
What is locale in Flutter
If you have multiple language support in your app, you need to work with locale. Locale could be confusing for beginners. An identifier used to select a user’s language and formatting preferences. It means you can save user’s language code and country code. In general in app, we set a default language code and country…
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 BLoC emit List()
Here we will see how to emit() List using flutter BLoC. BLoC state management emits any states and can be found from UI. First we will create event classes. The event classes would be responsible triggering events. Now let’s create state classes. Here LoadedList extends Equitable class and it makes this class stateful. This also…
Flutter Keep Application Awake
Let’s learn how to keep the application in flutter. You may install a plugin called wakelock This plugin keeps your the mobile screen awake as long as your application runs. You can do like below Here is an example how to use it in an app code. See how we used Wakelock.enable() to start out…
What’s Flutter BLoC state object?
Flutter BLoC state is an amazing object. It’s store all the data related to that BLoC class or Cubit class. If you use int, String, List or Map type object in your BLoC or Cubit class, You can find all of them from the state object. state is State object. State class extends Object class,…
Emit all the states in flutter bloc or cubit
It’s easy to emit() all the states in flutter bloc or cubit. Just do the below If you are using Cubit, then call the above code from inside a method() in your extended cubit class. If you are using BLoC, then call the above code from inside event() in your extended BLoC class. Inside the…