Explanation This code will display your hotels in a grid layout with 2 columns. You can adjust the crossAxisCount, crossAxisSpacing, mainAxisSpacing, and childAspectRatio properties to customize the grid’s appearance. The SliverGridDelegateWithFixedCrossAxisCount is a delegate for GridView that helps create a layout with a fixed number of columns across the horizontal axis. It provides control over…
Make sure wait until build context is ready
To ensure that you only execute certain code when the build context is fully ready, you can make use of the WidgetsBinding.instance.addPostFrameCallback method. This method schedules a callback that will be executed after the current frame is drawn, ensuring that the build context is fully initialized and mounted. Here’s an example of how you can…
Riverpod separate controller and pass ref object
Creating a separate controller allows for better separation of concerns in your code. By having a dedicated controller class, you can encapsulate the logic related to handling specific functionalities or operations, such as form submissions or API calls. This helps in keeping your notifier classes focused on managing state while delegating the business logic to…
Error: The getter ‘physicalGeometry’ isn’t defined for the class ‘FlutterView’.
The above error caused by flutter_screen util package. It’s a version update problem. To resolve the error make sure you have the latest version of the plugin. Error: The getter ‘physicalGeometry’ isn’t defined for the class ‘FlutterView’. Let’s change the version to the latest one flutter_screenutil: ^5.9.0
Firebase UI Auth package error
Running firebase package AuthProvider get the below error And the below error Solution Forcing firebase auth to use a specific version, which is firebase_auth: 4.12.0, solved my problem for now. It seems like the version 4.13.0 introduces a conflict with AuthProvider. If you changing firebase_auth version did not work, then change the version of firebase_ui_auth,…
Error-dump-failed-because-no-androidmanifest-xml-found
There are many reasons why this would happen. The only thing you could do is try the below steps and solutions one by one. This is mostly vscode error Anyone of the solution may work with you. Solution number 1 Solution number 2 Remove about app.apk in /build/app/outputs/apk/app.apk and rebuild. VS code may have this…
[firebase_auth/unknown] Please register custom URL scheme ‘app’
This is a common error Flutter iOS set up with firebase. To overcome this issue make sure you redownload the GoogleService-Info.plist file from firebase console and put in Runner folders inside iOS. In the file you will see REVERSED_CLIENT_ID copy that line and put the line inside info.plist file So put your REVERSED_CLIENT_ID like that.
Dart Ternary Operator with Flutter
Here we will see dart ternary operator along with flutter usage. Dart ternary operator looks like below ?: Now this may look like confusing. There are two parts of it. The first part is ? and the other part is : and they are used separately. Next thing we need to know that, we use…
Flutter screenUtil package initialization
Flutter screenutil is a great package for screen pixel adoption in different systems like Android and iOS. If you install flutter_screenutil package and initialize it correctly you will your screens looks same on the different platform and yet they are best fitted. Install it and get flutter pub add flutter_screenutil && flutter pub get And…
Why iOS developers are not getting jobs
I would think that, iOS developers are now needed in fine tuning apps like highly fine tech or specialized for optimization like big finance app and scientific apps for research. I also think iOS developers are only needed when you need to control every of bit pixels and extremely fast speed. Other than that Flutter…