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….
Flutter podfile 0 dependencies [Solved]
Code for Podfile 0 dependencies. It happens because your Podfile is empty. Nothing is there. Put the code below and run pod install. Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed.
[firebase_auth/invalid-credential] The supplied auth credential is malformed or has expired
This [firebase_auth/invalid-credential] The supplied auth credential is malformed or has expired could be an weird behavior. This could happen due to many reasons. This mostly happen on Android emulator. Solution I have encountered a weird one. This one happened due to emulator. I had to delete the app, reboot the emulator and reinstalled the app….
Flutter GridView 3 ways
There are different ways to achieve grid view results in Flutter. Here I will explain three ways to do grid views in Flutter CustomScrollView, GridView and GridView.builder. First one is using CustomScrollView. CustomScrollView is the most efficient way of doing it. It’s very optimized. If you have chatting app, then CustomScrollView is the best way…