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…
Category: Uncategorized
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…
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 AccentColor Deprecated
You may get the below error if you upgraded Flutter. The getter accentColor is not defined for ThemeData. To overcome this problem change accent color to anything you like Color myColor = Theme.of(context).colorScheme.secondary;
Flutter Todo Model Class
This is a very common Todo model class, here is the code. It’s used throughout many applications. So it’s better you save. I have used them in many applications on Flutter. Here I have created all the fields as optional which means some fields you may, some fields you skip. This class also comes with…
Flutter load and display csv file content
Flutter load and display csv file content. Previously we have seen how to load JSON file in flutter and display it’s content. We will be using a csv package for it. Let’ go ahead and download the csv package using the below command. And then run After that in your pubspec.yaml file make sure, you…
Flutter Flip Card 3D Animation
We will do flutter 3d animation of card image using AnimationController, Tween and AnimationStatus. We will do that using stateful class. Inside the class we will override initState() method and declare Here addListener() and addStatusListener() plays very important roles. Without them animation is not dynamic and not updated immediately. Because of this status listener, we…
Flutter Builder Widget
Flutter Builder widget is helpful and simple to use. There are two cases where you may use builder widget. Here we have an example that takes parent widget’s context and build the UI. Here you see for builder property we are passing a function with context and then returning a widget. This Builder widget helps…
Flutter ScaffoldMessenger, showSnackBar and snackBar
Here we will use ScaffoldMessenger, showSnackBar and snackBar together to show a message on button press from the bottom. Flutter ScaffoldMassenger is works for like showing pop up message. ScaffoldMassenger shows, hide and remove snackBar. The MaterialApp widget provides a root ScaffoldMessenger. If you show a SnackBar using the root ScaffoldMessenger, it becomes possible for all descendant Scaffolds to receive the SnackBar. However,…
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…