Yes, it’s overrated and difficult for beginners. Now, I am not saying this because I love other state management package or hate Riverpod. It causes problem and impossible to keep track of the error once you use Notifier Provider and AsyncNotifier Provider together. Riverpod does come with it’s benefit. Like AsyncLoading, AsyncData, AsyncValue. These are…
Month: September 2023
Great Solution ! Flutter Long Text inside Column
Let’s see how to put long text inside Column. Of course you have to put Text widget inside the Column widget a child. Here we will learn a specific rules to how it long should work every where. In general the below lay out won’t work. See the complex layout Row->Column->Text10Normal(). In this case Text10Normal()…
You Did Not About Know Access Token
There are at least two kinds of token we deal with. How access_token works in app or in Flutter framework. Now, how the access token should work and communication with the server, it’s a general idea of app building or architecture. The above code shows that we save our access_token to local storage. It does…
Flutter TextField Hide and Show | ScreenUtil
If you use flutter_screenutil package for mobile responsive adaptive size, It may mess up with the keyboard showing and hiding when you have text field to type in. If you do you use screen util package, it will make the text field attached to the bottom section of the app screen. To overcome this, you…
Flutter Riverpod and Dart only
I’ve seen many articles explaining how to use Riverpod in Flutter, but I haven’t found any that explain how to use Riverpod in Dart only, so I’ll write one. Preparation for provider automatic generation How to create a provider using riverpod_annotation Generating a Provider for String manipulation Generating a Provider for bool toggling Read Provider…
Flutter path_provider local storage
Flutter allows you to easily implement local storage. Below is the sample code for local storage in flutter. The sample code below we used the path_provider package to access the device’s file system. We also use the file class to manipulate files. Also, use the jsonEncode() method to convert the data to json format. I also use a textfield…
GlobalKey was used multiple times inside one widget’s child list.
GlobalKey was used multiple times inside one widget’s child list. this is console:Performing hot restart… Syncing files to device HD1901… Restarted application in 5,513ms. I/flutter ( 4581): route name is / I/flutter ( 4581): storage serve I/flutter ( 4581): pref_Instance of ‘SharedPreferences‘ Solutions You need to add await and async before you load sharedprefrerences. Inside…
When to use Equatable with BLoC
The purpose of Equatable package is to know if two Dart objects are same or they have the same hashCode or not. In general most of the time you would know as a developer that if two variables or objects are same or not. For example if you have a bool variable and you want…
Riverpod Providers or Controllers Folder
Now this seems very confusing when it comes to Riverpod. How we separate the business logic from the UI? Well, I’d consider Riverpod or any state management as part of the controller layer in terms of managing app logic and state, because it does what “controllers” are meant to do, pass information between the views…
Flutter Course List | Model
Flutter course list as json response from the server. This is used in our riverpod tutorial. You can use this model to convert server json data to an object. In general we are only interested in the code, msg and data section of the response. Data field may contain complex json or list of jsons….