The size (375, 812) is a common reference size for designing responsive user interfaces, especially for mobile apps. These dimensions are based on the screen size of the iPhone X, which has a resolution of 375 points wide by 812 points tall in logical pixels. This size is often used as a standard reference for…
Month: May 2024
Creating a Custom Scrollable App Bar With Expandable Text | Flutter
In this article, we will create a custom scrollable app bar with a background image in Flutter. The app bar will shrink as the user scrolls up, and it will include a back button. Below the image, we will display some descriptive text with a “More” or “Less” button to show or hide additional text….
In Depth Explanation for SliverGridDelegateWithFixedCrossAxisCount
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…