API calls are the most important aspect of any application. Fetching, posting, updating and deleting data are the common API calls used.
In this post, I ll share a way to implement API calls in your Flutter application using the GetX State Management (https://pub.dev/packages/get).
There are a lot more things provided by this package, but I am going to cover only the API calls using it in this post.
First of all, you ll need to add the package in your
get: <latest version>
Now as Flutter 2.0 released, a lot of things have changed. The first thing that I noticed was FlatButton and RaisedButton were deprecated.
Hmm, now what to use instead of them?
Using the Flutter documentation, I found out that instead of FlatButton we have to use TextButton and instead of RaisedButton we have to use ElevatedButton.
At first, I thought it might be change of just naming of buttons. However, that was not the case.
So let’s look how to use these buttons and style them.
By default TextButton has:
This is how it looks…
Switches or toggles are used quite often in mobile applications. And making them look good can become complex, if not done correctly.
Let me show you a easy way using which you can build a cool looking animated switch widget in Flutter.
Let’s first implement the base UI. After which we will add animations to it.
Firstly, create a stateful widget in a new file called AnimatedSwitch.dart.
You can type “stful” and press enter to automatically generate a widget if you are using vscode.
After you have done that, return a Container from the build and add some decoration to…
Today we will look into a way to manage API calls from front end.
In a considerably big app or website, we have to call a lot of APIs, which can be a pain if not handled properly. And can feel like …
API calls can contain many operations like Create, Read, Update, Delete etc…So for this tutorial purpose, I am considering CRUD operations on an entity.
Okay, now you will think what is entity here?🤔
Here, an entity could be a user👥 or a product📦 or anything on which you perform CRUD operations.
Okay now let’s go into…
A Video can be a key factor in keeping visitors longer on your website. The more they will engage, the better chance of converting them into customers.
So let’s look how we can store videos on our server.
Here, we will use express to create our server and multer to accept video files from our website.
Firstly create an empty directory and initialize npm in it.
npm init -y
After that, install express and multer in our project folder using below command.
npm install express multer
Okay, now let’s create our server first.
Create a file called server.js …
In our various web applications, we need to show notifications to users. There are many ways you can show notifications on your web applications. So here is one way I think is easy and usable.
This is what our final result is…
We will be working with three files just to keep everything organized.
Let us first design our notification UI.
As this is a tutorial, I’ll keep the design simple.
This is what we are going to build.
The first thing that will come to your mind is why to build something like this when you can put two images side-by-side.
Just an average guy, showing average coding content.